summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/settings/cyanogenmod/privacyguard/PrivacyGuardManager.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/settings/cyanogenmod/privacyguard/PrivacyGuardManager.java b/src/com/android/settings/cyanogenmod/privacyguard/PrivacyGuardManager.java
index 51942ae..4b49cf5 100644
--- a/src/com/android/settings/cyanogenmod/privacyguard/PrivacyGuardManager.java
+++ b/src/com/android/settings/cyanogenmod/privacyguard/PrivacyGuardManager.java
@@ -94,6 +94,7 @@ public class PrivacyGuardManager extends Fragment
public static final class AppInfo {
String title;
String packageName;
+ boolean enabled;
boolean privacyGuardEnabled;
}
@@ -245,14 +246,18 @@ public class PrivacyGuardManager extends Fragment
AppInfo app = new AppInfo();
app.title = appInfo.loadLabel(mPm).toString();
app.packageName = info.packageName;
+ app.enabled = appInfo.enabled;
app.privacyGuardEnabled = mPm.getPrivacyGuardSetting(app.packageName);
apps.add(app);
}
- // sort the apps by title
+ // sort the apps by their enabled state, then by title
Collections.sort(apps, new Comparator<AppInfo>() {
@Override
public int compare(AppInfo lhs, AppInfo rhs) {
+ if (lhs.enabled != rhs.enabled) {
+ return lhs.enabled ? -1 : 1;
+ }
return lhs.title.compareToIgnoreCase(rhs.title);
}
});