summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/location
diff options
context:
space:
mode:
authorDavid Christie <dnchrist@google.com>2013-09-20 17:50:55 -0700
committerDavid Christie <dnchrist@google.com>2013-09-20 18:08:54 -0700
commitbec860d6c465e0c9649f627624c7aaa5d934ad1f (patch)
treeab340943abd3a185bb3eed9a0d3fca9ce92923f1 /src/com/android/settings/location
parentde105da5500477d216d226cc342811e335f8bcb4 (diff)
downloadpackages_apps_Settings-bec860d6c465e0c9649f627624c7aaa5d934ad1f.zip
packages_apps_Settings-bec860d6c465e0c9649f627624c7aaa5d934ad1f.tar.gz
packages_apps_Settings-bec860d6c465e0c9649f627624c7aaa5d934ad1f.tar.bz2
Remove "Android System" from recent apps list in Settings (b/10855277)
Change-Id: I22d74c22c482786298af088abb7b25c790fd4b21
Diffstat (limited to 'src/com/android/settings/location')
-rw-r--r--src/com/android/settings/location/RecentLocationApps.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/com/android/settings/location/RecentLocationApps.java b/src/com/android/settings/location/RecentLocationApps.java
index 65fef80..dceafb7 100644
--- a/src/com/android/settings/location/RecentLocationApps.java
+++ b/src/com/android/settings/location/RecentLocationApps.java
@@ -22,6 +22,7 @@ import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
+import android.os.Process;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.util.Log;
@@ -40,6 +41,7 @@ import java.util.List;
*/
public class RecentLocationApps {
private static final String TAG = RecentLocationApps.class.getSimpleName();
+ private static final String ANDROID_SYSTEM_PACKAGE_NAME = "android";
private static final int RECENT_TIME_INTERVAL_MILLIS = 15 * 60 * 1000;
@@ -165,10 +167,14 @@ public class RecentLocationApps {
ArrayList<Preference> prefs = new ArrayList<Preference>();
long now = System.currentTimeMillis();
for (AppOpsManager.PackageOps ops : appOps) {
- BatterySipperWrapper wrapper = sipperMap.get(ops.getUid());
- Preference pref = getPreferenceFromOps(now, ops, wrapper);
- if (pref != null) {
- prefs.add(pref);
+ // Don't show the Android System in the list - it's not actionable for the user.
+ if (ops.getUid() != Process.SYSTEM_UID
+ || !ANDROID_SYSTEM_PACKAGE_NAME.equals(ops.getPackageName())) {
+ BatterySipperWrapper wrapper = sipperMap.get(ops.getUid());
+ Preference pref = getPreferenceFromOps(now, ops, wrapper);
+ if (pref != null) {
+ prefs.add(pref);
+ }
}
}