Loading core/java/android/service/notification/NotificationListenerService.java +13 −2 Original line number Diff line number Diff line Loading @@ -1522,6 +1522,7 @@ public abstract class NotificationListenerService extends Service { private ArrayList<Notification.Action> mSmartActions; private ArrayList<CharSequence> mSmartReplies; private boolean mCanBubble; private boolean mVisuallyInterruptive; private static final int PARCEL_VERSION = 2; Loading Loading @@ -1553,6 +1554,7 @@ public abstract class NotificationListenerService extends Service { out.writeTypedList(mSmartActions, flags); out.writeCharSequenceList(mSmartReplies); out.writeBoolean(mCanBubble); out.writeBoolean(mVisuallyInterruptive); } /** @hide */ Loading Loading @@ -1585,6 +1587,7 @@ public abstract class NotificationListenerService extends Service { mSmartActions = in.createTypedArrayList(Notification.Action.CREATOR); mSmartReplies = in.readCharSequenceList(); mCanBubble = in.readBoolean(); mVisuallyInterruptive = in.readBoolean(); } Loading Loading @@ -1771,6 +1774,11 @@ public abstract class NotificationListenerService extends Service { return mCanBubble; } /** @hide */ public boolean visuallyInterruptive() { return mVisuallyInterruptive; } /** @hide */ public boolean isNoisy() { return mNoisy; Loading @@ -1787,7 +1795,8 @@ public abstract class NotificationListenerService extends Service { ArrayList<SnoozeCriterion> snoozeCriteria, boolean showBadge, int userSentiment, boolean hidden, long lastAudiblyAlertedMs, boolean noisy, ArrayList<Notification.Action> smartActions, ArrayList<CharSequence> smartReplies, boolean canBubble) { ArrayList<CharSequence> smartReplies, boolean canBubble, boolean visuallyInterruptive) { mKey = key; mRank = rank; mIsAmbient = importance < NotificationManager.IMPORTANCE_LOW; Loading @@ -1808,6 +1817,7 @@ public abstract class NotificationListenerService extends Service { mSmartActions = smartActions; mSmartReplies = smartReplies; mCanBubble = canBubble; mVisuallyInterruptive = visuallyInterruptive; } /** Loading @@ -1832,7 +1842,8 @@ public abstract class NotificationListenerService extends Service { other.mNoisy, other.mSmartActions, other.mSmartReplies, other.mCanBubble); other.mCanBubble, other.mVisuallyInterruptive); } /** Loading packages/SystemUI/src/com/android/systemui/bubbles/BubbleData.java +4 −0 Original line number Diff line number Diff line Loading @@ -184,6 +184,8 @@ public class BubbleData { Log.d(TAG, "notificationEntryUpdated: " + entry); } Bubble bubble = getBubbleWithKey(entry.key); suppressFlyout = !entry.isVisuallyInterruptive || suppressFlyout; if (bubble == null) { // Create a new bubble bubble = new Bubble(mContext, entry); Loading @@ -193,8 +195,10 @@ public class BubbleData { } else { // Updates an existing bubble bubble.updateEntry(entry); bubble.setSuppressFlyout(suppressFlyout); doUpdate(bubble); } if (bubble.shouldAutoExpand()) { setSelectedBubbleInternal(bubble); if (!mExpanded) { Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java +8 −0 Original line number Diff line number Diff line Loading @@ -140,6 +140,12 @@ public final class NotificationEntry { */ private boolean hasSentReply; /** * Whether this notification has changed in visual appearance since the previous post. * New notifications are interruptive by default. */ public boolean isVisuallyInterruptive; /** * Whether this notification is shown to the user as a high priority notification: visible on * the lock screen/status bar and in the top section in the shade. Loading Loading @@ -205,6 +211,7 @@ public final class NotificationEntry { + " doesn't match existing key " + key); } mRanking = ranking; isVisuallyInterruptive = ranking.visuallyInterruptive(); } public NotificationChannel getChannel() { Loading Loading @@ -244,6 +251,7 @@ public final class NotificationEntry { return mRanking.canBubble(); } public @NonNull List<Notification.Action> getSmartActions() { return mRanking.getSmartActions(); } Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/RankingBuilder.java +3 −1 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ public class RankingBuilder { private ArrayList<Notification.Action> mSmartActions = new ArrayList<>(); private ArrayList<CharSequence> mSmartReplies = new ArrayList<>(); private boolean mCanBubble = false; private boolean mIsVisuallyInterruptive = false; public RankingBuilder() { } Loading Loading @@ -98,7 +99,8 @@ public class RankingBuilder { mNoisy, mSmartActions, mSmartReplies, mCanBubble); mCanBubble, mIsVisuallyInterruptive); return ranking; } Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationEntryManagerTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -183,7 +183,7 @@ public class NotificationEntryManagerTest extends SysuiTestCase { 0, NotificationManager.IMPORTANCE_DEFAULT, null, null, null, null, null, true, sentiment, false, -1, false, null, null, false); null, null, null, true, sentiment, false, -1, false, null, null, false, false); return true; }).when(mRankingMap).getRanking(eq(key), any(NotificationListenerService.Ranking.class)); } Loading @@ -202,7 +202,7 @@ public class NotificationEntryManagerTest extends SysuiTestCase { null, null, null, null, null, true, NotificationListenerService.Ranking.USER_SENTIMENT_NEUTRAL, false, -1, false, smartActions, null, false); false, smartActions, null, false, false); return true; }).when(mRankingMap).getRanking(eq(key), any(NotificationListenerService.Ranking.class)); } Loading Loading
core/java/android/service/notification/NotificationListenerService.java +13 −2 Original line number Diff line number Diff line Loading @@ -1522,6 +1522,7 @@ public abstract class NotificationListenerService extends Service { private ArrayList<Notification.Action> mSmartActions; private ArrayList<CharSequence> mSmartReplies; private boolean mCanBubble; private boolean mVisuallyInterruptive; private static final int PARCEL_VERSION = 2; Loading Loading @@ -1553,6 +1554,7 @@ public abstract class NotificationListenerService extends Service { out.writeTypedList(mSmartActions, flags); out.writeCharSequenceList(mSmartReplies); out.writeBoolean(mCanBubble); out.writeBoolean(mVisuallyInterruptive); } /** @hide */ Loading Loading @@ -1585,6 +1587,7 @@ public abstract class NotificationListenerService extends Service { mSmartActions = in.createTypedArrayList(Notification.Action.CREATOR); mSmartReplies = in.readCharSequenceList(); mCanBubble = in.readBoolean(); mVisuallyInterruptive = in.readBoolean(); } Loading Loading @@ -1771,6 +1774,11 @@ public abstract class NotificationListenerService extends Service { return mCanBubble; } /** @hide */ public boolean visuallyInterruptive() { return mVisuallyInterruptive; } /** @hide */ public boolean isNoisy() { return mNoisy; Loading @@ -1787,7 +1795,8 @@ public abstract class NotificationListenerService extends Service { ArrayList<SnoozeCriterion> snoozeCriteria, boolean showBadge, int userSentiment, boolean hidden, long lastAudiblyAlertedMs, boolean noisy, ArrayList<Notification.Action> smartActions, ArrayList<CharSequence> smartReplies, boolean canBubble) { ArrayList<CharSequence> smartReplies, boolean canBubble, boolean visuallyInterruptive) { mKey = key; mRank = rank; mIsAmbient = importance < NotificationManager.IMPORTANCE_LOW; Loading @@ -1808,6 +1817,7 @@ public abstract class NotificationListenerService extends Service { mSmartActions = smartActions; mSmartReplies = smartReplies; mCanBubble = canBubble; mVisuallyInterruptive = visuallyInterruptive; } /** Loading @@ -1832,7 +1842,8 @@ public abstract class NotificationListenerService extends Service { other.mNoisy, other.mSmartActions, other.mSmartReplies, other.mCanBubble); other.mCanBubble, other.mVisuallyInterruptive); } /** Loading
packages/SystemUI/src/com/android/systemui/bubbles/BubbleData.java +4 −0 Original line number Diff line number Diff line Loading @@ -184,6 +184,8 @@ public class BubbleData { Log.d(TAG, "notificationEntryUpdated: " + entry); } Bubble bubble = getBubbleWithKey(entry.key); suppressFlyout = !entry.isVisuallyInterruptive || suppressFlyout; if (bubble == null) { // Create a new bubble bubble = new Bubble(mContext, entry); Loading @@ -193,8 +195,10 @@ public class BubbleData { } else { // Updates an existing bubble bubble.updateEntry(entry); bubble.setSuppressFlyout(suppressFlyout); doUpdate(bubble); } if (bubble.shouldAutoExpand()) { setSelectedBubbleInternal(bubble); if (!mExpanded) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java +8 −0 Original line number Diff line number Diff line Loading @@ -140,6 +140,12 @@ public final class NotificationEntry { */ private boolean hasSentReply; /** * Whether this notification has changed in visual appearance since the previous post. * New notifications are interruptive by default. */ public boolean isVisuallyInterruptive; /** * Whether this notification is shown to the user as a high priority notification: visible on * the lock screen/status bar and in the top section in the shade. Loading Loading @@ -205,6 +211,7 @@ public final class NotificationEntry { + " doesn't match existing key " + key); } mRanking = ranking; isVisuallyInterruptive = ranking.visuallyInterruptive(); } public NotificationChannel getChannel() { Loading Loading @@ -244,6 +251,7 @@ public final class NotificationEntry { return mRanking.canBubble(); } public @NonNull List<Notification.Action> getSmartActions() { return mRanking.getSmartActions(); } Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/RankingBuilder.java +3 −1 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ public class RankingBuilder { private ArrayList<Notification.Action> mSmartActions = new ArrayList<>(); private ArrayList<CharSequence> mSmartReplies = new ArrayList<>(); private boolean mCanBubble = false; private boolean mIsVisuallyInterruptive = false; public RankingBuilder() { } Loading Loading @@ -98,7 +99,8 @@ public class RankingBuilder { mNoisy, mSmartActions, mSmartReplies, mCanBubble); mCanBubble, mIsVisuallyInterruptive); return ranking; } Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationEntryManagerTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -183,7 +183,7 @@ public class NotificationEntryManagerTest extends SysuiTestCase { 0, NotificationManager.IMPORTANCE_DEFAULT, null, null, null, null, null, true, sentiment, false, -1, false, null, null, false); null, null, null, true, sentiment, false, -1, false, null, null, false, false); return true; }).when(mRankingMap).getRanking(eq(key), any(NotificationListenerService.Ranking.class)); } Loading @@ -202,7 +202,7 @@ public class NotificationEntryManagerTest extends SysuiTestCase { null, null, null, null, null, true, NotificationListenerService.Ranking.USER_SENTIMENT_NEUTRAL, false, -1, false, smartActions, null, false); false, smartActions, null, false, false); return true; }).when(mRankingMap).getRanking(eq(key), any(NotificationListenerService.Ranking.class)); } Loading