summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/privacyguard
diff options
context:
space:
mode:
authorMatt Garnes <matt@cyngn.com>2015-05-15 15:55:44 -0700
committerRoman Birg <roman@cyngn.com>2015-11-03 12:21:37 -0800
commita3cd7854949870d606a24f6aa4a49e43060211b7 (patch)
tree9b68a810c999b51ee4813871891427b9ab096cf8 /src/com/android/settings/privacyguard
parent53ba451f0422b3cc6ae03d2089b116c47c1c39f0 (diff)
downloadpackages_apps_Settings-a3cd7854949870d606a24f6aa4a49e43060211b7.zip
packages_apps_Settings-a3cd7854949870d606a24f6aa4a49e43060211b7.tar.gz
packages_apps_Settings-a3cd7854949870d606a24f6aa4a49e43060211b7.tar.bz2
Do not allow privacy guard for core system apps.
Hide any applications that have the system UID as well as System UI from privacy guard. Enabling this on these core apps can have disastrous consequences, since many privacy guard authorization requests will queue up. This can cause the system process or System UI to be killed when they ANR while they wait at the end of a very long queue for the user to authorize them. By using privacy guard, you are trusting that the system will control and protect these permissions in the first place; there is no need to protect the system from itself. Change-Id: I478d6a6783a4c06fa7ad01a96c413290b232636c
Diffstat (limited to 'src/com/android/settings/privacyguard')
-rw-r--r--src/com/android/settings/privacyguard/AppInfoLoader.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/com/android/settings/privacyguard/AppInfoLoader.java b/src/com/android/settings/privacyguard/AppInfoLoader.java
index 8e3ea5f..6efd7a5 100644
--- a/src/com/android/settings/privacyguard/AppInfoLoader.java
+++ b/src/com/android/settings/privacyguard/AppInfoLoader.java
@@ -36,6 +36,9 @@ import java.util.List;
private PackageManager mPm;
private boolean mShowSystemApps;
private AppOpsManager mAppOps;
+ private static final String[] BLACKLISTED_PACKAGES = {
+ "com.android.systemui"
+ };
public AppInfoLoader(Context context, boolean showSystemApps) {
super(context);
@@ -64,6 +67,15 @@ import java.util.List;
cancelLoad();
}
+ private boolean isBlacklisted(String packageName) {
+ for (String pkg : BLACKLISTED_PACKAGES) {
+ if (pkg.equals(packageName)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
/**
* Uses the package manager to query for all currently installed apps
* for the list.
@@ -79,7 +91,9 @@ import java.util.List;
final ApplicationInfo appInfo = info.applicationInfo;
// skip all system apps if they shall not be included
- if (!mShowSystemApps && (appInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
+ if ((!mShowSystemApps && (appInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0)
+ || (appInfo.uid == android.os.Process.SYSTEM_UID)
+ || isBlacklisted(appInfo.packageName)) {
continue;
}