summaryrefslogtreecommitdiffstats
path: root/services/java/com/android/server/am/ActivityStack.java
diff options
context:
space:
mode:
authorSteve Kondik <shade@chemlab.org>2013-06-12 00:47:55 -0700
committerSteve Kondik <shade@chemlab.org>2013-06-24 11:36:22 -0700
commite48fce6da7bd839d70cbf69abb2780c6d30ea7f6 (patch)
tree49dd160f5a5d10847fd446e0db7f31f2d800792f /services/java/com/android/server/am/ActivityStack.java
parentb429a08331e8ebea15113fe287f4e5c9478d7001 (diff)
downloadframeworks_base-e48fce6da7bd839d70cbf69abb2780c6d30ea7f6.zip
frameworks_base-e48fce6da7bd839d70cbf69abb2780c6d30ea7f6.tar.gz
frameworks_base-e48fce6da7bd839d70cbf69abb2780c6d30ea7f6.tar.bz2
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
Diffstat (limited to 'services/java/com/android/server/am/ActivityStack.java')
-rw-r--r--services/java/com/android/server/am/ActivityStack.java34
1 files changed, 34 insertions, 0 deletions
diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java
index 885ec89..4e9973f 100644
--- a/services/java/com/android/server/am/ActivityStack.java
+++ b/services/java/com/android/server/am/ActivityStack.java
@@ -1803,9 +1803,43 @@ final class ActivityStack {
startSpecificActivityLocked(next, true, true);
}
+ handlePrivacyGuardNotification(prev, next);
+
return true;
}
+ private final void handlePrivacyGuardNotification(ActivityRecord prev, ActivityRecord next) {
+ boolean curPrivacy = false;
+ boolean prevPrivacy = false;
+
+ if (next != null) {
+ try {
+ curPrivacy = AppGlobals.getPackageManager().getPrivacyGuardSetting(
+ next.packageName, next.userId);
+ } catch (RemoteException e) {
+ // nothing
+ }
+ }
+ if (prev != null) {
+ try {
+ prevPrivacy = AppGlobals.getPackageManager().getPrivacyGuardSetting(
+ prev.packageName, prev.userId);
+ } catch (RemoteException e) {
+ // nothing
+ }
+ }
+ if (prevPrivacy && !curPrivacy) {
+ Message msg = mService.mHandler.obtainMessage(
+ ActivityManagerService.CANCEL_PRIVACY_NOTIFICATION_MSG, prev.userId);
+ msg.sendToTarget();
+ } else if ((!prevPrivacy && curPrivacy) ||
+ (prevPrivacy && curPrivacy && !next.packageName.equals(prev.packageName))) {
+ Message msg = mService.mHandler.obtainMessage(
+ ActivityManagerService.POST_PRIVACY_NOTIFICATION_MSG, next);
+ msg.sendToTarget();
+ }
+ }
+
private final void startActivityLocked(ActivityRecord r, boolean newTask,
boolean doResume, boolean keepCurTransition, Bundle options) {
final int NH = mHistory.size();