Update empty state for apps bypassing dnd

Test: atest
Fixes: 150346679
Change-Id: Iccc5f1fb3dd7ee2c114f8757a020833b3b41e91d
This commit is contained in:
Julia Reynolds
2020-03-09 18:47:45 -04:00
parent ed3fc8626d
commit 44b5b7c575
4 changed files with 18 additions and 5 deletions

View File

@@ -105,9 +105,7 @@ public class ZenModeAllBypassingAppsPreferenceController extends AbstractPrefere
ApplicationsState.AppFilter filter = ApplicationsState.FILTER_ALL_ENABLED;
List<ApplicationsState.AppEntry> apps = mAppSession.rebuild(filter,
ApplicationsState.ALPHA_COMPARATOR);
if (apps != null) {
updateNotificationChannelList(apps);
}
updateNotificationChannelList(apps);
}
@VisibleForTesting
@@ -116,6 +114,8 @@ public class ZenModeAllBypassingAppsPreferenceController extends AbstractPrefere
return;
}
boolean showEmptyState = true;
List<Preference> channelsBypassingDnd = new ArrayList<>();
for (ApplicationsState.AppEntry entry : apps) {
String pkg = entry.info.packageName;
@@ -148,6 +148,7 @@ public class ZenModeAllBypassingAppsPreferenceController extends AbstractPrefere
return true;
});
channelsBypassingDnd.add(pref);
showEmptyState = false;
}
mPreferenceScreen.removeAll();
@@ -156,6 +157,11 @@ public class ZenModeAllBypassingAppsPreferenceController extends AbstractPrefere
mPreferenceScreen.addPreference(prefToAdd);
}
}
if (showEmptyState) {
Preference pref = new Preference(mPrefContext);
pref.setTitle(R.string.zen_mode_bypassing_apps_subtext_none);
mPreferenceScreen.addPreference(pref);
}
}
}