Loading core/java/android/service/notification/ZenPolicy.java +22 −3 Original line number Diff line number Diff line Loading @@ -349,23 +349,29 @@ public final class ZenPolicy implements Parcelable { /** * Indicates no explicit setting for which channels may bypass DND when this policy is active. * Defaults to {@link #CHANNEL_POLICY_PRIORITY}. * * @hide */ @FlaggedApi(Flags.FLAG_MODES_API) private static final int CHANNEL_POLICY_UNSET = 0; public static final int CHANNEL_POLICY_UNSET = 0; /** * Indicates that channels marked as {@link NotificationChannel#canBypassDnd()} can bypass DND * when this policy is active. * * @hide */ @FlaggedApi(Flags.FLAG_MODES_API) private static final int CHANNEL_POLICY_PRIORITY = 1; public static final int CHANNEL_POLICY_PRIORITY = 1; /** * Indicates that no channels can bypass DND when this policy is active, even those marked as * {@link NotificationChannel#canBypassDnd()}. * * @hide */ @FlaggedApi(Flags.FLAG_MODES_API) private static final int CHANNEL_POLICY_NONE = 2; public static final int CHANNEL_POLICY_NONE = 2; /** @hide */ public ZenPolicy() { Loading Loading @@ -563,6 +569,13 @@ public final class ZenPolicy implements Parcelable { return mVisualEffects.get(VISUAL_EFFECT_NOTIFICATION_LIST); } /** * @hide */ public @ChannelType int getAllowedChannels() { return mAllowChannels; } /** * Whether this policy allows {@link NotificationChannel channels} marked as * {@link NotificationChannel#canBypassDnd()} to bypass DND. If {@link #STATE_ALLOW}, these Loading Loading @@ -999,6 +1012,12 @@ public final class ZenPolicy implements Parcelable { mZenPolicy.mAllowChannels = allow ? CHANNEL_POLICY_PRIORITY : CHANNEL_POLICY_NONE; return this; } /** @hide */ public @NonNull Builder allowChannels(@ChannelType int channelType) { mZenPolicy.mAllowChannels = channelType; return this; } } @Override Loading Loading
core/java/android/service/notification/ZenPolicy.java +22 −3 Original line number Diff line number Diff line Loading @@ -349,23 +349,29 @@ public final class ZenPolicy implements Parcelable { /** * Indicates no explicit setting for which channels may bypass DND when this policy is active. * Defaults to {@link #CHANNEL_POLICY_PRIORITY}. * * @hide */ @FlaggedApi(Flags.FLAG_MODES_API) private static final int CHANNEL_POLICY_UNSET = 0; public static final int CHANNEL_POLICY_UNSET = 0; /** * Indicates that channels marked as {@link NotificationChannel#canBypassDnd()} can bypass DND * when this policy is active. * * @hide */ @FlaggedApi(Flags.FLAG_MODES_API) private static final int CHANNEL_POLICY_PRIORITY = 1; public static final int CHANNEL_POLICY_PRIORITY = 1; /** * Indicates that no channels can bypass DND when this policy is active, even those marked as * {@link NotificationChannel#canBypassDnd()}. * * @hide */ @FlaggedApi(Flags.FLAG_MODES_API) private static final int CHANNEL_POLICY_NONE = 2; public static final int CHANNEL_POLICY_NONE = 2; /** @hide */ public ZenPolicy() { Loading Loading @@ -563,6 +569,13 @@ public final class ZenPolicy implements Parcelable { return mVisualEffects.get(VISUAL_EFFECT_NOTIFICATION_LIST); } /** * @hide */ public @ChannelType int getAllowedChannels() { return mAllowChannels; } /** * Whether this policy allows {@link NotificationChannel channels} marked as * {@link NotificationChannel#canBypassDnd()} to bypass DND. If {@link #STATE_ALLOW}, these Loading Loading @@ -999,6 +1012,12 @@ public final class ZenPolicy implements Parcelable { mZenPolicy.mAllowChannels = allow ? CHANNEL_POLICY_PRIORITY : CHANNEL_POLICY_NONE; return this; } /** @hide */ public @NonNull Builder allowChannels(@ChannelType int channelType) { mZenPolicy.mAllowChannels = channelType; return this; } } @Override Loading