diff options
Diffstat (limited to 'core/java/android/provider/Settings.java')
| -rw-r--r-- | core/java/android/provider/Settings.java | 18 |
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); |
