Loading core/java/android/service/notification/NotificationListenerService.java +13 −2 Original line number Original line Diff line number Diff line Loading @@ -1514,6 +1514,7 @@ public abstract class NotificationListenerService extends Service { private ArrayList<Notification.Action> mSmartActions; private ArrayList<Notification.Action> mSmartActions; private ArrayList<CharSequence> mSmartReplies; private ArrayList<CharSequence> mSmartReplies; private boolean mCanBubble; private boolean mCanBubble; private boolean mVisuallyInterruptive; private static final int PARCEL_VERSION = 2; private static final int PARCEL_VERSION = 2; Loading Loading @@ -1545,6 +1546,7 @@ public abstract class NotificationListenerService extends Service { out.writeTypedList(mSmartActions, flags); out.writeTypedList(mSmartActions, flags); out.writeCharSequenceList(mSmartReplies); out.writeCharSequenceList(mSmartReplies); out.writeBoolean(mCanBubble); out.writeBoolean(mCanBubble); out.writeBoolean(mVisuallyInterruptive); } } /** @hide */ /** @hide */ Loading Loading @@ -1577,6 +1579,7 @@ public abstract class NotificationListenerService extends Service { mSmartActions = in.createTypedArrayList(Notification.Action.CREATOR); mSmartActions = in.createTypedArrayList(Notification.Action.CREATOR); mSmartReplies = in.readCharSequenceList(); mSmartReplies = in.readCharSequenceList(); mCanBubble = in.readBoolean(); mCanBubble = in.readBoolean(); mVisuallyInterruptive = in.readBoolean(); } } Loading Loading @@ -1763,6 +1766,11 @@ public abstract class NotificationListenerService extends Service { return mCanBubble; return mCanBubble; } } /** @hide */ public boolean visuallyInterruptive() { return mVisuallyInterruptive; } /** @hide */ /** @hide */ public boolean isNoisy() { public boolean isNoisy() { return mNoisy; return mNoisy; Loading @@ -1779,7 +1787,8 @@ public abstract class NotificationListenerService extends Service { ArrayList<SnoozeCriterion> snoozeCriteria, boolean showBadge, ArrayList<SnoozeCriterion> snoozeCriteria, boolean showBadge, int userSentiment, boolean hidden, long lastAudiblyAlertedMs, int userSentiment, boolean hidden, long lastAudiblyAlertedMs, boolean noisy, ArrayList<Notification.Action> smartActions, boolean noisy, ArrayList<Notification.Action> smartActions, ArrayList<CharSequence> smartReplies, boolean canBubble) { ArrayList<CharSequence> smartReplies, boolean canBubble, boolean visuallyInterruptive) { mKey = key; mKey = key; mRank = rank; mRank = rank; mIsAmbient = importance < NotificationManager.IMPORTANCE_LOW; mIsAmbient = importance < NotificationManager.IMPORTANCE_LOW; Loading @@ -1800,6 +1809,7 @@ public abstract class NotificationListenerService extends Service { mSmartActions = smartActions; mSmartActions = smartActions; mSmartReplies = smartReplies; mSmartReplies = smartReplies; mCanBubble = canBubble; mCanBubble = canBubble; mVisuallyInterruptive = visuallyInterruptive; } } /** /** Loading @@ -1824,7 +1834,8 @@ public abstract class NotificationListenerService extends Service { other.mNoisy, other.mNoisy, other.mSmartActions, other.mSmartActions, other.mSmartReplies, other.mSmartReplies, other.mCanBubble); other.mCanBubble, other.mVisuallyInterruptive); } } /** /** Loading packages/SystemUI/src/com/android/systemui/bubbles/BubbleData.java +4 −0 Original line number Original line Diff line number Diff line Loading @@ -184,6 +184,8 @@ public class BubbleData { Log.d(TAG, "notificationEntryUpdated: " + entry); Log.d(TAG, "notificationEntryUpdated: " + entry); } } Bubble bubble = getBubbleWithKey(entry.key); Bubble bubble = getBubbleWithKey(entry.key); suppressFlyout = !entry.isVisuallyInterruptive || suppressFlyout; if (bubble == null) { if (bubble == null) { // Create a new bubble // Create a new bubble bubble = new Bubble(mContext, entry); bubble = new Bubble(mContext, entry); Loading @@ -193,8 +195,10 @@ public class BubbleData { } else { } else { // Updates an existing bubble // Updates an existing bubble bubble.updateEntry(entry); bubble.updateEntry(entry); bubble.setSuppressFlyout(suppressFlyout); doUpdate(bubble); doUpdate(bubble); } } if (bubble.shouldAutoExpand()) { if (bubble.shouldAutoExpand()) { setSelectedBubbleInternal(bubble); setSelectedBubbleInternal(bubble); if (!mExpanded) { if (!mExpanded) { Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java +7 −0 Original line number Original line Diff line number Diff line Loading @@ -154,6 +154,12 @@ public final class NotificationEntry { */ */ public boolean canBubble; public boolean canBubble; /** * 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 * 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. * the lock screen/status bar and in the top section in the shade. Loading Loading @@ -196,6 +202,7 @@ public final class NotificationEntry { suppressedVisualEffects = ranking.getSuppressedVisualEffects(); suppressedVisualEffects = ranking.getSuppressedVisualEffects(); suspended = ranking.isSuspended(); suspended = ranking.isSuspended(); canBubble = ranking.canBubble(); canBubble = ranking.canBubble(); isVisuallyInterruptive = ranking.visuallyInterruptive(); } } public void setInterruption() { public void setInterruption() { Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationEntryManagerTest.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -182,7 +182,7 @@ public class NotificationEntryManagerTest extends SysuiTestCase { 0, 0, NotificationManager.IMPORTANCE_DEFAULT, NotificationManager.IMPORTANCE_DEFAULT, null, null, 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; return true; }).when(mRankingMap).getRanking(eq(key), any(NotificationListenerService.Ranking.class)); }).when(mRankingMap).getRanking(eq(key), any(NotificationListenerService.Ranking.class)); } } Loading @@ -201,7 +201,7 @@ public class NotificationEntryManagerTest extends SysuiTestCase { null, null, null, null, null, null, null, true, null, null, null, true, NotificationListenerService.Ranking.USER_SENTIMENT_NEUTRAL, false, -1, NotificationListenerService.Ranking.USER_SENTIMENT_NEUTRAL, false, -1, false, smartActions, null, false); false, smartActions, null, false, false); return true; return true; }).when(mRankingMap).getRanking(eq(key), any(NotificationListenerService.Ranking.class)); }).when(mRankingMap).getRanking(eq(key), any(NotificationListenerService.Ranking.class)); } } Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotificationDataTest.java +4 −1 Original line number Original line Diff line number Diff line Loading @@ -623,6 +623,7 @@ public class NotificationDataTest extends SysuiTestCase { public static final String OVERRIDE_SMART_ACTIONS = "sa"; public static final String OVERRIDE_SMART_ACTIONS = "sa"; public static final String OVERRIDE_SMART_REPLIES = "sr"; public static final String OVERRIDE_SMART_REPLIES = "sr"; public static final String OVERRIDE_BUBBLE = "cb"; public static final String OVERRIDE_BUBBLE = "cb"; public static final String OVERRIDE_VISUALLY_INTERRUPTIVE = "vi"; public Map<String, Bundle> rankingOverrides = new HashMap<>(); public Map<String, Bundle> rankingOverrides = new HashMap<>(); Loading Loading @@ -683,7 +684,9 @@ public class NotificationDataTest extends SysuiTestCase { overrides.containsKey(OVERRIDE_SMART_REPLIES) overrides.containsKey(OVERRIDE_SMART_REPLIES) ? overrides.getCharSequenceArrayList(OVERRIDE_SMART_REPLIES) ? overrides.getCharSequenceArrayList(OVERRIDE_SMART_REPLIES) : currentReplies, : currentReplies, overrides.getBoolean(OVERRIDE_BUBBLE, outRanking.canBubble())); overrides.getBoolean(OVERRIDE_BUBBLE, outRanking.canBubble()), overrides.getBoolean(OVERRIDE_VISUALLY_INTERRUPTIVE, outRanking.visuallyInterruptive())); } } return true; return true; } } Loading Loading
core/java/android/service/notification/NotificationListenerService.java +13 −2 Original line number Original line Diff line number Diff line Loading @@ -1514,6 +1514,7 @@ public abstract class NotificationListenerService extends Service { private ArrayList<Notification.Action> mSmartActions; private ArrayList<Notification.Action> mSmartActions; private ArrayList<CharSequence> mSmartReplies; private ArrayList<CharSequence> mSmartReplies; private boolean mCanBubble; private boolean mCanBubble; private boolean mVisuallyInterruptive; private static final int PARCEL_VERSION = 2; private static final int PARCEL_VERSION = 2; Loading Loading @@ -1545,6 +1546,7 @@ public abstract class NotificationListenerService extends Service { out.writeTypedList(mSmartActions, flags); out.writeTypedList(mSmartActions, flags); out.writeCharSequenceList(mSmartReplies); out.writeCharSequenceList(mSmartReplies); out.writeBoolean(mCanBubble); out.writeBoolean(mCanBubble); out.writeBoolean(mVisuallyInterruptive); } } /** @hide */ /** @hide */ Loading Loading @@ -1577,6 +1579,7 @@ public abstract class NotificationListenerService extends Service { mSmartActions = in.createTypedArrayList(Notification.Action.CREATOR); mSmartActions = in.createTypedArrayList(Notification.Action.CREATOR); mSmartReplies = in.readCharSequenceList(); mSmartReplies = in.readCharSequenceList(); mCanBubble = in.readBoolean(); mCanBubble = in.readBoolean(); mVisuallyInterruptive = in.readBoolean(); } } Loading Loading @@ -1763,6 +1766,11 @@ public abstract class NotificationListenerService extends Service { return mCanBubble; return mCanBubble; } } /** @hide */ public boolean visuallyInterruptive() { return mVisuallyInterruptive; } /** @hide */ /** @hide */ public boolean isNoisy() { public boolean isNoisy() { return mNoisy; return mNoisy; Loading @@ -1779,7 +1787,8 @@ public abstract class NotificationListenerService extends Service { ArrayList<SnoozeCriterion> snoozeCriteria, boolean showBadge, ArrayList<SnoozeCriterion> snoozeCriteria, boolean showBadge, int userSentiment, boolean hidden, long lastAudiblyAlertedMs, int userSentiment, boolean hidden, long lastAudiblyAlertedMs, boolean noisy, ArrayList<Notification.Action> smartActions, boolean noisy, ArrayList<Notification.Action> smartActions, ArrayList<CharSequence> smartReplies, boolean canBubble) { ArrayList<CharSequence> smartReplies, boolean canBubble, boolean visuallyInterruptive) { mKey = key; mKey = key; mRank = rank; mRank = rank; mIsAmbient = importance < NotificationManager.IMPORTANCE_LOW; mIsAmbient = importance < NotificationManager.IMPORTANCE_LOW; Loading @@ -1800,6 +1809,7 @@ public abstract class NotificationListenerService extends Service { mSmartActions = smartActions; mSmartActions = smartActions; mSmartReplies = smartReplies; mSmartReplies = smartReplies; mCanBubble = canBubble; mCanBubble = canBubble; mVisuallyInterruptive = visuallyInterruptive; } } /** /** Loading @@ -1824,7 +1834,8 @@ public abstract class NotificationListenerService extends Service { other.mNoisy, other.mNoisy, other.mSmartActions, other.mSmartActions, other.mSmartReplies, other.mSmartReplies, other.mCanBubble); other.mCanBubble, other.mVisuallyInterruptive); } } /** /** Loading
packages/SystemUI/src/com/android/systemui/bubbles/BubbleData.java +4 −0 Original line number Original line Diff line number Diff line Loading @@ -184,6 +184,8 @@ public class BubbleData { Log.d(TAG, "notificationEntryUpdated: " + entry); Log.d(TAG, "notificationEntryUpdated: " + entry); } } Bubble bubble = getBubbleWithKey(entry.key); Bubble bubble = getBubbleWithKey(entry.key); suppressFlyout = !entry.isVisuallyInterruptive || suppressFlyout; if (bubble == null) { if (bubble == null) { // Create a new bubble // Create a new bubble bubble = new Bubble(mContext, entry); bubble = new Bubble(mContext, entry); Loading @@ -193,8 +195,10 @@ public class BubbleData { } else { } else { // Updates an existing bubble // Updates an existing bubble bubble.updateEntry(entry); bubble.updateEntry(entry); bubble.setSuppressFlyout(suppressFlyout); doUpdate(bubble); doUpdate(bubble); } } if (bubble.shouldAutoExpand()) { if (bubble.shouldAutoExpand()) { setSelectedBubbleInternal(bubble); setSelectedBubbleInternal(bubble); if (!mExpanded) { if (!mExpanded) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java +7 −0 Original line number Original line Diff line number Diff line Loading @@ -154,6 +154,12 @@ public final class NotificationEntry { */ */ public boolean canBubble; public boolean canBubble; /** * 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 * 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. * the lock screen/status bar and in the top section in the shade. Loading Loading @@ -196,6 +202,7 @@ public final class NotificationEntry { suppressedVisualEffects = ranking.getSuppressedVisualEffects(); suppressedVisualEffects = ranking.getSuppressedVisualEffects(); suspended = ranking.isSuspended(); suspended = ranking.isSuspended(); canBubble = ranking.canBubble(); canBubble = ranking.canBubble(); isVisuallyInterruptive = ranking.visuallyInterruptive(); } } public void setInterruption() { public void setInterruption() { Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationEntryManagerTest.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -182,7 +182,7 @@ public class NotificationEntryManagerTest extends SysuiTestCase { 0, 0, NotificationManager.IMPORTANCE_DEFAULT, NotificationManager.IMPORTANCE_DEFAULT, null, null, 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; return true; }).when(mRankingMap).getRanking(eq(key), any(NotificationListenerService.Ranking.class)); }).when(mRankingMap).getRanking(eq(key), any(NotificationListenerService.Ranking.class)); } } Loading @@ -201,7 +201,7 @@ public class NotificationEntryManagerTest extends SysuiTestCase { null, null, null, null, null, null, null, true, null, null, null, true, NotificationListenerService.Ranking.USER_SENTIMENT_NEUTRAL, false, -1, NotificationListenerService.Ranking.USER_SENTIMENT_NEUTRAL, false, -1, false, smartActions, null, false); false, smartActions, null, false, false); return true; return true; }).when(mRankingMap).getRanking(eq(key), any(NotificationListenerService.Ranking.class)); }).when(mRankingMap).getRanking(eq(key), any(NotificationListenerService.Ranking.class)); } } Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotificationDataTest.java +4 −1 Original line number Original line Diff line number Diff line Loading @@ -623,6 +623,7 @@ public class NotificationDataTest extends SysuiTestCase { public static final String OVERRIDE_SMART_ACTIONS = "sa"; public static final String OVERRIDE_SMART_ACTIONS = "sa"; public static final String OVERRIDE_SMART_REPLIES = "sr"; public static final String OVERRIDE_SMART_REPLIES = "sr"; public static final String OVERRIDE_BUBBLE = "cb"; public static final String OVERRIDE_BUBBLE = "cb"; public static final String OVERRIDE_VISUALLY_INTERRUPTIVE = "vi"; public Map<String, Bundle> rankingOverrides = new HashMap<>(); public Map<String, Bundle> rankingOverrides = new HashMap<>(); Loading Loading @@ -683,7 +684,9 @@ public class NotificationDataTest extends SysuiTestCase { overrides.containsKey(OVERRIDE_SMART_REPLIES) overrides.containsKey(OVERRIDE_SMART_REPLIES) ? overrides.getCharSequenceArrayList(OVERRIDE_SMART_REPLIES) ? overrides.getCharSequenceArrayList(OVERRIDE_SMART_REPLIES) : currentReplies, : currentReplies, overrides.getBoolean(OVERRIDE_BUBBLE, outRanking.canBubble())); overrides.getBoolean(OVERRIDE_BUBBLE, outRanking.canBubble()), overrides.getBoolean(OVERRIDE_VISUALLY_INTERRUPTIVE, outRanking.visuallyInterruptive())); } } return true; return true; } } Loading