Support (non-editable) display of DND with a filter != PRIORITY
Whenever setInterruptionFilter() is called with NONE or ALARMS, the Do Not Disturb mode now shows the current policy (nothing allowed or alarms/media allowed), instead of the normal PRIORITY policy. This policy is read-only in the UI since it cannot be customized. This should be, or at least become, pretty rare (with small exceptions, apps targeting V that call setInterruptionFilter() will use an implicit mode instead of changing the global zen mode, plus using these filters is quite nonstandard in itself). Fixes: 361586248 Test: atest & manual (toggling DND via cmd shell) Flag: android.app.modes_ui Change-Id: If2439480235d30aa310ad8925341183b9761784c
This commit is contained in:
@@ -92,7 +92,7 @@ class ZenModeAppsLinkPreferenceController extends AbstractZenModePreferenceContr
|
||||
|
||||
@Override
|
||||
public boolean isAvailable(ZenMode zenMode) {
|
||||
return zenMode.getRule().getInterruptionFilter() != INTERRUPTION_FILTER_ALL;
|
||||
return zenMode.getInterruptionFilter() != INTERRUPTION_FILTER_ALL;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -102,7 +102,7 @@ class ZenModeAppsLinkPreferenceController extends AbstractZenModePreferenceContr
|
||||
preference.setIntent(
|
||||
ZenSubSettingLauncher.forModeFragment(mContext, ZenModeAppsFragment.class,
|
||||
zenMode.getId(), SettingsEnums.ZEN_PRIORITY_MODE).toIntent());
|
||||
preference.setEnabled(zenMode.isEnabled());
|
||||
preference.setEnabled(zenMode.isEnabled() && zenMode.canEditPolicy());
|
||||
|
||||
mZenMode = zenMode;
|
||||
mPreference = (CircularIconsPreference) preference;
|
||||
|
||||
Reference in New Issue
Block a user