Loading core/api/current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -40614,7 +40614,7 @@ package android.service.notification { method public int getPriorityCategoryReminders(); method public int getPriorityCategoryRepeatCallers(); method public int getPriorityCategorySystem(); method @FlaggedApi("android.app.modes_api") public int getPriorityChannels(); method @FlaggedApi("android.app.modes_api") public int getPriorityChannelsAllowed(); method public int getPriorityConversationSenders(); method public int getPriorityMessageSenders(); method public int getVisualEffectAmbient(); core/java/android/service/notification/ZenModeConfig.java +2 −2 Original line number Diff line number Diff line Loading @@ -1053,7 +1053,7 @@ public class ZenModeConfig implements Parcelable { out); if (Flags.modesApi()) { writeZenPolicyState(ALLOW_ATT_CHANNELS, policy.getPriorityChannels(), out); writeZenPolicyState(ALLOW_ATT_CHANNELS, policy.getPriorityChannelsAllowed(), out); } } Loading Loading @@ -1381,7 +1381,7 @@ public class ZenModeConfig implements Parcelable { int state = defaultPolicy.state; if (Flags.modesApi()) { state = Policy.policyState(defaultPolicy.hasPriorityChannels(), ZenPolicy.stateToBoolean(zenPolicy.getPriorityChannels(), ZenPolicy.stateToBoolean(zenPolicy.getPriorityChannelsAllowed(), DEFAULT_ALLOW_PRIORITY_CHANNELS)); } Loading core/java/android/service/notification/ZenPolicy.java +2 −2 Original line number Diff line number Diff line Loading @@ -570,7 +570,7 @@ public final class ZenPolicy implements Parcelable { * with {@link NotificationChannel#canBypassDnd()} will be intercepted. */ @FlaggedApi(Flags.FLAG_MODES_API) public @State int getPriorityChannels() { public @State int getPriorityChannelsAllowed() { switch (mAllowChannels) { case CHANNEL_POLICY_PRIORITY: return STATE_ALLOW; Loading Loading @@ -1529,7 +1529,7 @@ public final class ZenPolicy implements Parcelable { proto.write(DNDPolicyProto.ALLOW_CONVERSATIONS_FROM, getPriorityConversationSenders()); if (Flags.modesApi()) { proto.write(DNDPolicyProto.ALLOW_CHANNELS, getPriorityChannels()); proto.write(DNDPolicyProto.ALLOW_CHANNELS, getPriorityChannelsAllowed()); } proto.flush(); Loading services/core/java/com/android/server/notification/ZenModeHelper.java +1 −1 Original line number Diff line number Diff line Loading @@ -1183,7 +1183,7 @@ public class ZenModeHelper { != newPolicy.getPriorityConversationSenders()) { userModifiedFields |= ZenPolicy.FIELD_CONVERSATIONS; } if (oldPolicy.getPriorityChannels() != newPolicy.getPriorityChannels()) { if (oldPolicy.getPriorityChannelsAllowed() != newPolicy.getPriorityChannelsAllowed()) { userModifiedFields |= ZenPolicy.FIELD_ALLOW_CHANNELS; } if (oldPolicy.getPriorityCategoryReminders() Loading services/tests/uiservicestests/src/com/android/server/notification/ZenAdaptersTest.java +6 −4 Original line number Diff line number Diff line Loading @@ -143,12 +143,13 @@ public class ZenAdaptersTest extends UiServiceTestCase { Policy.policyState(false, true), 0); ZenPolicy zenPolicy = notificationPolicyToZenPolicy(policy); assertThat(zenPolicy.getPriorityChannels()).isEqualTo(ZenPolicy.STATE_ALLOW); assertThat(zenPolicy.getPriorityChannelsAllowed()).isEqualTo(ZenPolicy.STATE_ALLOW); Policy notAllowed = new Policy(0, 0, 0, 0, Policy.policyState(false, false), 0); ZenPolicy zenPolicyNotAllowed = notificationPolicyToZenPolicy(notAllowed); assertThat(zenPolicyNotAllowed.getPriorityChannels()).isEqualTo(ZenPolicy.STATE_DISALLOW); assertThat(zenPolicyNotAllowed.getPriorityChannelsAllowed()).isEqualTo( ZenPolicy.STATE_DISALLOW); } @Test Loading @@ -158,11 +159,12 @@ public class ZenAdaptersTest extends UiServiceTestCase { Policy.policyState(false, true), 0); ZenPolicy zenPolicy = notificationPolicyToZenPolicy(policy); assertThat(zenPolicy.getPriorityChannels()).isEqualTo(ZenPolicy.STATE_UNSET); assertThat(zenPolicy.getPriorityChannelsAllowed()).isEqualTo(ZenPolicy.STATE_UNSET); Policy notAllowed = new Policy(0, 0, 0, 0, Policy.policyState(false, false), 0); ZenPolicy zenPolicyNotAllowed = notificationPolicyToZenPolicy(notAllowed); assertThat(zenPolicyNotAllowed.getPriorityChannels()).isEqualTo(ZenPolicy.STATE_UNSET); assertThat(zenPolicyNotAllowed.getPriorityChannelsAllowed()).isEqualTo( ZenPolicy.STATE_UNSET); } } Loading
core/api/current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -40614,7 +40614,7 @@ package android.service.notification { method public int getPriorityCategoryReminders(); method public int getPriorityCategoryRepeatCallers(); method public int getPriorityCategorySystem(); method @FlaggedApi("android.app.modes_api") public int getPriorityChannels(); method @FlaggedApi("android.app.modes_api") public int getPriorityChannelsAllowed(); method public int getPriorityConversationSenders(); method public int getPriorityMessageSenders(); method public int getVisualEffectAmbient();
core/java/android/service/notification/ZenModeConfig.java +2 −2 Original line number Diff line number Diff line Loading @@ -1053,7 +1053,7 @@ public class ZenModeConfig implements Parcelable { out); if (Flags.modesApi()) { writeZenPolicyState(ALLOW_ATT_CHANNELS, policy.getPriorityChannels(), out); writeZenPolicyState(ALLOW_ATT_CHANNELS, policy.getPriorityChannelsAllowed(), out); } } Loading Loading @@ -1381,7 +1381,7 @@ public class ZenModeConfig implements Parcelable { int state = defaultPolicy.state; if (Flags.modesApi()) { state = Policy.policyState(defaultPolicy.hasPriorityChannels(), ZenPolicy.stateToBoolean(zenPolicy.getPriorityChannels(), ZenPolicy.stateToBoolean(zenPolicy.getPriorityChannelsAllowed(), DEFAULT_ALLOW_PRIORITY_CHANNELS)); } Loading
core/java/android/service/notification/ZenPolicy.java +2 −2 Original line number Diff line number Diff line Loading @@ -570,7 +570,7 @@ public final class ZenPolicy implements Parcelable { * with {@link NotificationChannel#canBypassDnd()} will be intercepted. */ @FlaggedApi(Flags.FLAG_MODES_API) public @State int getPriorityChannels() { public @State int getPriorityChannelsAllowed() { switch (mAllowChannels) { case CHANNEL_POLICY_PRIORITY: return STATE_ALLOW; Loading Loading @@ -1529,7 +1529,7 @@ public final class ZenPolicy implements Parcelable { proto.write(DNDPolicyProto.ALLOW_CONVERSATIONS_FROM, getPriorityConversationSenders()); if (Flags.modesApi()) { proto.write(DNDPolicyProto.ALLOW_CHANNELS, getPriorityChannels()); proto.write(DNDPolicyProto.ALLOW_CHANNELS, getPriorityChannelsAllowed()); } proto.flush(); Loading
services/core/java/com/android/server/notification/ZenModeHelper.java +1 −1 Original line number Diff line number Diff line Loading @@ -1183,7 +1183,7 @@ public class ZenModeHelper { != newPolicy.getPriorityConversationSenders()) { userModifiedFields |= ZenPolicy.FIELD_CONVERSATIONS; } if (oldPolicy.getPriorityChannels() != newPolicy.getPriorityChannels()) { if (oldPolicy.getPriorityChannelsAllowed() != newPolicy.getPriorityChannelsAllowed()) { userModifiedFields |= ZenPolicy.FIELD_ALLOW_CHANNELS; } if (oldPolicy.getPriorityCategoryReminders() Loading
services/tests/uiservicestests/src/com/android/server/notification/ZenAdaptersTest.java +6 −4 Original line number Diff line number Diff line Loading @@ -143,12 +143,13 @@ public class ZenAdaptersTest extends UiServiceTestCase { Policy.policyState(false, true), 0); ZenPolicy zenPolicy = notificationPolicyToZenPolicy(policy); assertThat(zenPolicy.getPriorityChannels()).isEqualTo(ZenPolicy.STATE_ALLOW); assertThat(zenPolicy.getPriorityChannelsAllowed()).isEqualTo(ZenPolicy.STATE_ALLOW); Policy notAllowed = new Policy(0, 0, 0, 0, Policy.policyState(false, false), 0); ZenPolicy zenPolicyNotAllowed = notificationPolicyToZenPolicy(notAllowed); assertThat(zenPolicyNotAllowed.getPriorityChannels()).isEqualTo(ZenPolicy.STATE_DISALLOW); assertThat(zenPolicyNotAllowed.getPriorityChannelsAllowed()).isEqualTo( ZenPolicy.STATE_DISALLOW); } @Test Loading @@ -158,11 +159,12 @@ public class ZenAdaptersTest extends UiServiceTestCase { Policy.policyState(false, true), 0); ZenPolicy zenPolicy = notificationPolicyToZenPolicy(policy); assertThat(zenPolicy.getPriorityChannels()).isEqualTo(ZenPolicy.STATE_UNSET); assertThat(zenPolicy.getPriorityChannelsAllowed()).isEqualTo(ZenPolicy.STATE_UNSET); Policy notAllowed = new Policy(0, 0, 0, 0, Policy.policyState(false, false), 0); ZenPolicy zenPolicyNotAllowed = notificationPolicyToZenPolicy(notAllowed); assertThat(zenPolicyNotAllowed.getPriorityChannels()).isEqualTo(ZenPolicy.STATE_UNSET); assertThat(zenPolicyNotAllowed.getPriorityChannelsAllowed()).isEqualTo( ZenPolicy.STATE_UNSET); } }