summaryrefslogtreecommitdiffstats
path: root/core/java/android/provider/Settings.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 /core/java/android/provider/Settings.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 'core/java/android/provider/Settings.java')
-rw-r--r--core/java/android/provider/Settings.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 90b9b32..22fa2fa 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -18,6 +18,7 @@ package android.provider;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
+import android.app.ActivityManagerNative;
import android.app.SearchManager;
import android.app.WallpaperManager;
import android.content.ComponentName;
@@ -37,6 +38,7 @@ import android.net.ConnectivityManager;
import android.net.Uri;
import android.net.wifi.WifiManager;
import android.os.BatteryManager;
+import android.os.Binder;
import android.os.Bundle;
import android.os.DropBoxManager;
import android.os.IBinder;
@@ -5021,6 +5023,12 @@ public final class Settings {
public static final String ADVANCED_REBOOT = "advanced_reboot";
/**
+ * Whether newly installed apps should run with privacy guard by default
+ * @hide
+ */
+ public static final String PRIVACY_GUARD_DEFAULT = "privacy_guard_default";
+
+ /**
* This are the settings to be backed up.
*
* NOTE: Settings are backed up and restored in the order they appear
@@ -5063,7 +5071,8 @@ public final class Settings {
UI_NIGHT_MODE,
LOCK_SCREEN_OWNER_INFO,
LOCK_SCREEN_OWNER_INFO_ENABLED,
- ADVANCED_REBOOT
+ ADVANCED_REBOOT,
+ PRIVACY_GUARD_DEFAULT
};
/**
@@ -5085,6 +5094,13 @@ public final class Settings {
* @hide
*/
public static final boolean isLocationProviderEnabledForUser(ContentResolver cr, String provider, int userId) {
+ try {
+ if (ActivityManagerNative.getDefault().isPrivacyGuardEnabledForProcess(Binder.getCallingPid())) {
+ return false;
+ }
+ } catch (RemoteException e) {
+ // ignore
+ }
String allowedProviders = Settings.Secure.getStringForUser(cr,
LOCATION_PROVIDERS_ALLOWED, userId);
return TextUtils.delimitedStringContains(allowedProviders, ',', provider);