OSDN Git Service

Settings: Notification light: Fix for app customization
authorMichael W <baddaemon87@gmail.com>
Sun, 18 Sep 2016 15:39:21 +0000 (17:39 +0200)
committerLuca Stefani <luca.stefani.ge1@gmail.com>
Sun, 18 Sep 2016 17:07:50 +0000 (10:07 -0700)
If the list was filled with an app which gets deinstalled,
the previously introduced explanation is not shown anymore.
Make the display dependent on the real amount of added prefs,
not on the expected amount of apps in the list.

Change-Id: Id1f674d519a440e3d811d4dd565d760c045e9f84

src/com/android/settings/notificationlight/NotificationLightSettings.java

index c4b55d4..b17918a 100644 (file)
@@ -286,7 +286,7 @@ public class NotificationLightSettings extends SettingsPreferenceFragment implem
             }
 
             /* Display a pref explaining how to add apps */
-            if (mPackages.size() == 0) {
+            if (mApplicationPrefList.getPreferenceCount() == 0) {
                 String summary = getResources().getString(
                         R.string.notification_light_no_apps_summary);
                 String useCustom = getResources().getString(