Design refresh for modes that don't filter notifications
And fix a crash noticed in ZenModeAppsLinkPreferenceController Test: atest com/android/settings/notification/modes Fixes: 308820027 Flag: android.app.modes_ui Change-Id: I0cfe4e10ca7ff97dac3b3b8756cc36f4d6f91ea2
This commit is contained in:
@@ -38,11 +38,9 @@ public class ZenModeAppsPreferenceController extends
|
||||
|
||||
static final String KEY_PRIORITY = "zen_mode_apps_priority";
|
||||
static final String KEY_NONE = "zen_mode_apps_none";
|
||||
static final String KEY_ALL = "zen_mode_apps_all";
|
||||
|
||||
String mModeId;
|
||||
|
||||
|
||||
public ZenModeAppsPreferenceController(@NonNull Context context,
|
||||
@NonNull String key, @Nullable ZenModesBackend backend) {
|
||||
super(context, key, backend);
|
||||
@@ -79,13 +77,6 @@ public class ZenModeAppsPreferenceController extends
|
||||
== ZenPolicy.CHANNEL_POLICY_NONE;
|
||||
pref.setChecked(policy_none);
|
||||
break;
|
||||
case KEY_ALL:
|
||||
// A UI-only setting; the underlying policy never actually has this value,
|
||||
// but ZenMode acts as though it does for the sake of UI consistency.
|
||||
boolean policy_all = zenMode.getPolicy().getAllowedChannels()
|
||||
== ZenMode.CHANNEL_POLICY_ALL;
|
||||
pref.setChecked(policy_all);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,8 +87,6 @@ public class ZenModeAppsPreferenceController extends
|
||||
return savePolicy(p -> p.allowChannels(ZenPolicy.CHANNEL_POLICY_PRIORITY));
|
||||
case KEY_NONE:
|
||||
return savePolicy(p -> p.allowChannels(ZenPolicy.CHANNEL_POLICY_NONE));
|
||||
case KEY_ALL:
|
||||
return savePolicy(p -> p.allowChannels(ZenMode.CHANNEL_POLICY_ALL));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user