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.

Change-Id: Id7c54d728e63acb2b02a2a9322930b54949f6c5d

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/cm_strings.xml
	services/java/com/android/server/LocationManagerService.java
	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
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.

Change-Id: I2f2ecd0b75ff51b44b1a6035189355d7bd63eaf4

Conflicts:
	services/java/com/android/server/LocationManagerService.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

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
Add SMS Middleware layer.

Add fix so ordered broadcasts are delivered to system
apps first in the event of a tie. This works around
the issue where terrible apps steal SMS notifications
from the broadcast queue to simply prevent notifications
that could otherwise be removed by a toggle.

Change-Id: I4fff0c584f8fce9c5f2f4fe86a82fe6480c307c7

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

Change-Id: I4cf28df3a4878a98fbf6ab227e9e899ce86b7770