frameworks/base: Fix aliasing violations

Fix violations of strict aliasing rules

Change-Id: Ia83db6a0be18f52e8f274c581c3b42f031b39247
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
Signed-off-by: Paul Beeler <sparksco@gmail.com>
Forward port features from sm-jb-mr1 branch
Signed-off-by: Paul Beeler <sparksco@gmail.com>
CM Privacy Guard (1/2)

framework: Privacy Guard

 * Introduce a new privacy feature which allows the user to run an
   application with reduced visibility into his or her personal data.
 * Adds a per-application flag and simple API to determine if this flag
   is enabled for the current or calling process.
 * This flag can be used by content providers to decide if they should
   return a limited/empty dataset.

Signed-off-by: Paul Beeler <sparksco@gmail.com>

Add missing @hide annotations for Privacy Guard

privacy guard: Use LocationBlacklist for location filtering

 * Google has built a per-package blacklist into the location service.
 * Let's use this to handle Privacy Guard instead of our one-off code
   which has a bunch of edge cases and can leave apps in a weird state.

Signed-off-by: Paul Beeler <sparksco@gmail.com>

Conflicts:
	core/java/android/app/ActivityManagerNative.java
	core/java/android/app/IActivityManager.java
	core/java/android/content/Context.java
	core/java/android/content/pm/PackageUserState.java
	core/java/android/provider/Settings.java
	core/res/res/values/strings.xml
	core/res/res/values/symbols.xml
	services/java/com/android/server/am/ActivityManagerService.java
	services/java/com/android/server/am/BroadcastQueue.java
	services/java/com/android/server/pm/PackageManagerService.java
	services/java/com/android/server/pm/PackageSettingBase.java
	services/java/com/android/server/pm/Settings.java
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
Signed-off-by: Paul Beeler <sparksco@gmail.com>

Conflicts:
	services/java/com/android/server/am/ActivityStack.java
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
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
PrivacyGuard: New icons close to AOSP style
Fix