Update empty state for apps bypassing dnd
Test: atest Fixes: 150346679 Change-Id: Iccc5f1fb3dd7ee2c114f8757a020833b3b41e91d
This commit is contained in:
@@ -9,7 +9,7 @@ import com.android.settingslib.core.lifecycle.Lifecycle;
|
||||
|
||||
public class ZenModeBypassingAppsPreferenceController extends AbstractZenModePreferenceController {
|
||||
|
||||
protected static final String KEY = "zen_mode_bypassing_apps";
|
||||
protected static final String KEY = "zen_mode_behavior_apps";
|
||||
private NotificationBackend mNotificationBackend = new NotificationBackend();
|
||||
|
||||
public ZenModeBypassingAppsPreferenceController(Context context, Lifecycle lifecycle) {
|
||||
@@ -18,13 +18,16 @@ public class ZenModeBypassingAppsPreferenceController extends AbstractZenModePre
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
return mNotificationBackend.getNumAppsBypassingDnd(UserHandle.getCallingUserId()) != 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSummary() {
|
||||
final int channelsBypassing =
|
||||
mNotificationBackend.getNumAppsBypassingDnd(UserHandle.getCallingUserId());
|
||||
if (channelsBypassing == 0) {
|
||||
return mContext.getResources().getString(R.string.zen_mode_bypassing_apps_subtext_none);
|
||||
}
|
||||
return mContext.getResources().getQuantityString(R.plurals.zen_mode_bypassing_apps_subtext,
|
||||
channelsBypassing, channelsBypassing);
|
||||
}
|
||||
|
Reference in New Issue
Block a user