am: Fix the privacy guard notification

 * The privacy guard notification was not showing everytime. Fix the
   logic and handle it in the right place so it hits both the create and
   resume startup path.

Change-Id: I80c88ffb0fcb4ed3ea64ceb228bb436975278ecc
Frameworks: privacy guard fix possible NPE

If the user flash a data app over recovery on clean flash
(like a lot themed apps or gapps packages are doing)
the user will get into a bootloop because of an NPE
due an unknown state of the user due that
installedUser == null

To fix it
Check if installUser exists if yes then
call the provider settings value for the current
user

PatchSet 2+3: message update
	      fix for real now

Change-Id: Ie5f94a0d0a11ae24fdfdc8372c0433b26793b66e
Revert behavior of DateUtils.formatElapsedTime

Change Ib3c1e1aad05827df646aa18645cce19dffb7551f fixes the inability
to display more that 2-digit hour values, but also changes the behavior
of <10 minutes display by zero-padding the minutes. This makes
the Chronometer widget look different, and breaks Holo CTS.

Fix it so that for values under 600 seconds, the minutes don't
get padded

Change-Id: I34eb7f22e728c55bf3313ed1987ac32969cd5ed0
Fix DateUtils.formatElapsedTime, again

Remove extraneous "hours" argument in the <10 minutes case

Change-Id: I5a5913d2e0744f5783f8422cddc30603c7bd703f
LTE toggle: fix supported modes

Change-Id: Iba828b00072dadb4ec0058b7158f2187e1ac1f2d
Signed-off-by: Jonathan Steadman <xxwhitehawk@gmail.com>
LTE Toggle: add missing network mode NT_MODE_LTE_WCDMA

Change-Id: I93db32d4700568d79230350ff67e5dc0227a0c30
Signed-off-by: Jonathan Steadman <xxwhitehawk@gmail.com>
Send out USER_PRESENT broadcast on screen on if lockscreen is disabled.

This makes sure to turn off the notification LED on screen on when the
lockscreen is disabled by profile or e.g. by lockscreen toggle tile.

Change-Id: I0f6a5f9a021abd2799c22c744ab1180cee027409
Delay closing the notification area after swiping a little closer.

Use the same value as when removing all notifications.

Change-Id: Id11a48bc47487fd7763503dcbc769d9dbf5ad16a
When DPM is updated while lock screen is inhibited, don't
unconditionally enable lock screen.

Change-Id: Iab2af06eb8e41fbcfc6adfbeb5b42a9bbf446fe9
Don't consider input restricted when the lockscreen is disabled by an
app.

Fixes the secure lockscreen occasionally appearing when disabling the
lockscreen via tile.

Change-Id: I078584d0235c1cc958f89ce12ddf3cc1117a5687
update SystemUI's proguard.flags

Change-Id: I5aa73eddd3fea6cddeddaf94e202d8de870e7df5
Allow multiple emulated storages at the same time.

Only do multiuser mapping for primary emulated storage as per google docs.
Allow all non-primary emulated storage to have id other than 0 so that
it could be distinguished from the primary volume.

Change-Id: I7b70b9067fd6211055fb9074710f48107d7b0e8e
Avoid adding FORWARD_LOCK flag to an updated system app

Consider the following case:
1. An app exists in /system/app or /vendor/app. (i.e, it's a system app)
2. If the app would be updated as a forward-lock app by downloading from
   market(google play), then it would be installed in /data/app-private.
3. Moreover, if it would be updated by the whole system image (i.e, FOTA
   or something like that), then the app would be applied a FORWARD_LOCK
   flag.

The app SHOULD NOT have a FORWARD_LCOK flag. Because the resource path
of such app does not refer to the proper resources to access.

Change-Id: I0750f69a93a3115f4201029796b598507de3555f
Revert "Fix build with java 7"

This reverts commit c430247fc2ab4a17ceee929b2b3502a3460e418e.
Don't enable GPS if the requesting app is blacklisted.

This is transparent to the app, it just sees no location callbacks as
before. It just avoids the additional unneeded battery drain.

Change-Id: Iff98bcc3a4ff724aea8763e08b687441bda9ede0
Profile: Filter on NETWORK_STATE_CHANGED instead of SUPPLICANT_STATE_CHANGED

For more reliable network change detection use NETWORK_STATE_CHANGED
instead of SUPPLICANT_STATE_CHANGED

Only set profile when profile actually changed.
Use getWifiSsid instead of getSSID so we dont have to strip double
quotes ourselves, add null pointer exception check because function can
now be called when WiFi is off.

Change-Id: I2b4ea65fdb484edb39a14725c648d9ab0d5d36fb
Frameworks: privacy guard fix UI freeze

randomly sometimes the complete UI freezes when toggle
privacy guard. Move out the forcekill from syncronized to
fix it so that it kills the app when all threads are open
and they can react to the forcekill which cannot result then in unknown states

cheers

Change-Id: I81514dc5ca9149477ee747a7d90720b83f741baa
Fix to NullPointerException when activity is relaunched

When ChooseTypeAndAccountActivity is relaunched and resumed
by ActivityManager a call is made to onActivityResult without
first triggering onResume. This leads to mAccounts object
still being null.

Fixed by properly setting mAccounts object if it is null prior
to use after function onCreate has been called.

Change-Id: Ife7e1e052c473970d923fa43ee6189eb62a1113b
Final fix for recent apps orientation

Besides the known showImpl (called every single time when recent apps is shown or hidden), Override onSizeChanged method for setting recent hints on orientation changes, and restore hints in onUiHidden method. The perfect match

Conflicts:
	packages/SystemUI/src/com/android/systemui/recent/RecentsActivity.java
	packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java

Change-Id: Ieb9ccd076223d08df6e41ac62641f302d6708595

Conflicts:
	packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
Add permission that allows cancelling notifications from other apps.

Change-Id: I055b17873e174f71174898a7649b1e221fd8c436

Conflicts:
	core/res/res/values/cm_strings.xml