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:
@@ -50,7 +50,8 @@ class ZenModeExitAtAlarmPreferenceController extends
|
||||
if (mSchedule.exitAtAlarm != exitAtAlarm) {
|
||||
mSchedule.exitAtAlarm = exitAtAlarm;
|
||||
return saveMode(mode -> {
|
||||
mode.getRule().setConditionId(ZenModeConfig.toScheduleConditionId(mSchedule));
|
||||
mode.setCustomModeConditionId(mContext,
|
||||
ZenModeConfig.toScheduleConditionId(mSchedule));
|
||||
return mode;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user