DO NOT MERGE Clear deprecated effects when saving zen policy

- Deprecated effects are set in NotificationManagerService,
so unset them before setting the NotificationPolicy
- When user clicks on Custom, they are brought to the custom vis effects
page instead of resetting custom values to presets

Fixes: 79383781
Test: manual
Test: NotificationManagerServiceTest testSetNotificationPolicy_preP_setOldNewFields
Change-Id: Id6db9ce2aaeed6321389f8dbfbea65eda30c74ad
This commit is contained in:
Beverly
2018-05-08 10:41:25 -04:00
committed by Beverly Tai
parent e30007dcc0
commit 17c6de8e68
4 changed files with 23 additions and 30 deletions

View File

@@ -150,18 +150,4 @@ public class ZenModeVisEffectsCustomPreferenceControllerTest {
verify(mockPref).setOnGearClickListener(any());
verify(mockPref).setOnRadioButtonClickListener(any());
}
@Test
public void select() {
int interruptiveSuppressed = SUPPRESSED_EFFECT_FULL_SCREEN_INTENT
| SUPPRESSED_EFFECT_AMBIENT
| SUPPRESSED_EFFECT_LIGHTS
| SUPPRESSED_EFFECT_PEEK;
mBackend.mPolicy = new NotificationManager.Policy(0, 0, 0, 1);
mController.select();
verify(mBackend).savePolicy(anyInt(), anyInt(), anyInt(), eq(interruptiveSuppressed));
verify(mFeatureFactory.metricsFeatureProvider).action(eq(mContext),
eq(ACTION_ZEN_CUSTOM),
eq(true));
}
}