Eliminate unnecessary intent ANY_DATA_STATE broadcast

Log shows that over 300 intent android.intent.action.ANY_DATA_STATE
were broadcasted during power-up. Some of them were not necessary.
And, those additional intents will impact the device power-up
performance.
To avoid it, add checks to broadcast the intent only when
the data state does get changed.

Change-Id: I9feac82cdbd0a6737f4535194177dc83c763b998
Fix cursor memory leak

In current code, if an application opens a cursor to access a
provider, and doesn't close that cursor, later, when this cursor
is garbage collected, it won't get closed. This will cause a memory
leak in the provider. The leaked memory can only be reclaimed when
the application with the leaked cursor was dead.

The solution is, close the cursor when it's garbage collected.

Change-Id: I786915c46d4672b6b1b37414b3bc1ff8cea2e00b
Fix wrong count return for getPhoneSignalStrengthCount

Test report for the time spent in each signal strength bin, along
with the number of times that bin was entered showed the result
as Bin=3 Time=3211926000 Count=0. With a non-zero Time, the Count
value 0 was wrong.

The cause of the problem was that getPhoneSignalStrengthCount() used
mPhoneDataConnectionsTimer, instead of mPhoneSignalStrengthsTimer,
to get the count.

Change-Id: I55ac1125abfcfdc105605d76d1c706ac315b90cc
StrictMode.permitCustomSlowCalls() should call disable(DETECT_CUSTOM)
Added missing viewport meta tag to html resources

The viewport meta tag was missing in the translated html resources,
which caused small unreadable error pages in Androids Browser when using
other languages than the default english one.

Change-Id: Icf6fbb6b5efc2de9bc18887bed5db009675bb313
Signed-off-by: Dominik <dominik@dominikschuermann.de>
Properly handle quick switch between Home button and Gallery app

This change fixes the following bug:

1. Playing a movie (especially Full HD) by Gallery.
2. Press the Home button.
3. Press the Gallery shortcut on Launcher.
4. Very quickly repeat #2 and #3 several times.

Result: "Sorry, this video cannot be played" alert is shown.

Change-Id: Idf9d222ca1e0bb90bfe06f6dc807dfbc71b6415b
Signed-off-by: Yuriy Zabroda <yuriy.zabroda@ti.com>
Doesn't display input PIN number after cancel the PIN screen

Set mEnteredDigits to zero when press cancel key.

Change-Id: Ib7c25e5f7f34dd9c280aad78da7cec707140c38f
Signed-off-by: Charles Li<liyuchenlp@gmail.com>
Fix off-by-one error when filtering application UIDs

A filtering check in writeLPr() mistakenly includes the first application UID
(10000) with the result that the package with UID 10000 is missing from
packages.list. This patch fix the error.

Change-Id: I3651beb346290db8e09317391b95a77aed1946b6
Signed-off-by: Magnus Eriksson <eriksson.mag@gmail.com>
Performance: Activity manager perf unnecessary recalc of oom_adj (from ICS)

If an activity has bound servicesor content providers,
updateLruProcessInternalLocked will be called recursively with
the oomAdj flag set, resulting in several recalculations of oomAdj
with unchanged data. Doing it at the end of the top level call to
updateLruProcessInternalLocked should be sufficient.

Change-Id: I95e27011e1d3519f256a9bd756cbb18d43e8db29
ActivityManagerService: stay away from zombie content providers (from ICS)

When the lowmemorykiller kills a content provider in an unfortunate
moment, an innocent client app can become attached to a zombie provider
and be unconditionally killed moments after, when the dead provider is
being removed.
Prevent this race by addition of isAlive function to Process.java that
determines whether a process is still running and is not only a zombie,
add a check of the state of the provider process to getContentProviderImpl.

Change-Id: Id753b8dab103e4b447c4138468938ca9f5cb857d
Merge remote-tracking branch 'cm/jellybean' into jb-gn
Make "SD Card removed" notification dismissible if the removed SD Card is not the primary storage

The Galaxy S uses the "external SD Card" as the extended storage
and it the notification should be dismissible as it's okay not
to have it.

Additionally, this patch also not hide the USB storage mount dialog
if the removed storage is not the primary storage

Change-Id: I524b294c57ba80f19cf1af808af65ce1308f5a0b
DevicePolicyManagerService: Allow KEEP_SCREEN_ON

Don't clear Settings.System.STAY_ON_WHILE_PLUGGED_IN just
because device policy sets a maximum screen lock time.
It's meant as a security measure but it's broken.
Any third party app with android.permission.WRITE_SETTINGS
can override the disabling at any time. This only causes
major inconvenience for developers without any added security
and should be disabled.

Change-Id: I1477792e3909022d951f9629dee6a00a7e69a5ea
Backlight settings, preliminary, but works

based on CM9 code

Change-Id: Iddcbee98f6588bba428c4059e786d946d7ce2298
Add Center Clock-Framework Part

Change-Id: I80cfef86d556a468925ec22f42dd1638f7c90565
Allow mounting of multiple volumes via mass storage (framework part)

Cherry-pick from CM9.

The volumes to mount is taken from storage_list.xml (allowMassStorage)
rather than ro.additionalmounts in CM7.

Hand ported from the following patches:

commit 0233209827d95221399b1fe0185f79863fc6bf26
Author: Tony Layher <layhertony@gmail.com>
Date:   Sun Jan 2 12:46:38 2011 -0500

    forward port of 93bb95929a0c017498625a87654b4d114fe17b96 to allow mounting and sharing of mulitple volumes to MountService.

    Change-Id: I9fa3994e6e7b85360b451f57c1cdd4df921bc035

(the second part of the above patch was not ported)

commit 678fadf517126c8468ef2d8dcaea9c9fce96035b
Author: Josh Stone <cuviper@gmail.com>
Date:   Sun Nov 7 13:38:58 2010 -0800

    MountService: Remount all volumes after USB disconnect

    If USB was removed while UMS was enabled, the MountService was only
    remounting the primary share.  Any other shares, like the HTC Inc's
    emmc, were left in limbo.  This patch now iterates over *all* shared
    volumes to remount after disconnect.

    Change-Id: Ie6fd49ad80ba6fa0e4e194a386549cac786b4bbe
    Signed-off-by: Josh Stone <cuviper@gmail.com>

commit b1da9ed003edcd10ccda56fdf087e8f1b0f77b2a
Author: Josh Stone <cuviper@gmail.com>
Date:   Sat Jan 22 12:03:53 2011 -0800

    MountService: Only notify PackageManager for true ASEC changes

    MountService can be dealing with multiple mounts (emmc, sdcard), but
    only the EXTERNAL_STORAGE has any ASEC mounts on it.  Since the PMS
    updateExternalMediaStatus doesn't specify the path, we need to make sure
    it's only called for the real ASEC mount.  Otherwise we get into nasty
    race conditions when multiple mounts are coming and going, like during
    UMS transitions, and sdcard-installed apps tend to break.

    Change-Id: I85c6a601e84afd30b44270b0892686c2d864ce8d

commit c8c58f3d14fbb8c77ab1e90541e59fb74bef54cf
Author: Josh Stone <cuviper@gmail.com>
Date:   Sun Mar 6 12:34:50 2011 -0800

    MountService: Unmount secondary volumes more carefully

    Use the same message handler for unmounting both the ASEC external-
    storage path and any secondary paths like emmc.  This seems to help with
    additional race conditions encountered on Inc.

    Change-Id: Icca71756fa6721bd85da1f35b8b8c7fc7caa1eb1

commit 47495ab860ed97499e0c4268bf40b1f9c429bf99
Author: atinm <atinm.dev@gmail.com>
Date:   Sun Apr 10 14:50:41 2011 -0400

    Allow multiple shareable SD Cards by using getShareableVolumes()
    to get all the volumes that are shareable and allowing
    sharing/unsharing for all of them rather than just the hardcoded
    getExternalStorage calls.

    Unmount immediately if PM is not updating and not an ASEC
    mount. Change from Josh Stone.
    Change-Id: Iaf1a7a4484deac373e1c1d7bf16d5f22ca49fd64

    Only allow package manager for sdcard (packages aren't on
    external card).

    Change-Id: I0d148ea52dc1285905a9dd061d1ceedcfb761b52

    Take out extra logging.

    Change-Id: I6beb007700ef4be04c3eb273bbf2069c87b30011

Change-Id: Ibc11b9affdf22a438a4d25cf14435fb16b3ad6d6
Improve scrolling cache

Scrolling cache helps make short scrolls/flings smooth but will
cause stutter when long flings are made. This patch disables
scrolling cache when long flings are made.

This patch also fixes a related bug where scrolling cache will
not be enabled properly when transitioning from flinging to scrolling.

Patch Set 2: Calculate threshold based on maximum velocity (Sang Tae Park)

Change-Id: I1fdbaad92263c9f983a32900e74eba1f0367902b
Fix display of mobile status bar icon when using airplane mode

Change-Id: Icb5b33008f97eaefd67bb4e5acd1e38bcf2dcb70
Remove power widget background

Change-Id: Id0bff63011666539a97b262a3f4975f07639a4f4
Hardware key custom rebinding (1/2)

Framework changes to allow rebinding of the actions performed on the following
key press events: Home long-press, menu press, menu long-press, search press,
search long-press, app-switch press and app-switch long-press.

The available actions are: Nothing, open/close menu, recent apps switcher,
search assistant, voice search and in-app search.

Patch Set 1: Initial port from ICS [done by Konstantin Koslowski]
Patch Set 2: Added 'assist' (search) key customisation
             Option for ICS-style in-app search, in addition to jellybean-style
             search assistant.
             Fixed double haptic feedback on virtual key press.
Patch Set 3: Checkbox to enable/disable all custom bindings.
             Home long-press defaults to no action on devices with
             an app-switch key.
Patch Set 4: The recent apps list will be preloaded on the initial down press
             of whichever key to which it is bound.

Change-Id: If790aae7cf266f90d1afa07acfe91129b2d19489