Loading core/java/android/service/notification/NotificationListenerService.java +9 −9 Original line number Diff line number Diff line Loading @@ -1699,7 +1699,7 @@ public abstract class NotificationListenerService extends Service { private ArrayList<Notification.Action> mSmartActions; private ArrayList<CharSequence> mSmartReplies; private boolean mCanBubble; private boolean mVisuallyInterruptive; private boolean mIsTextChanged; private boolean mIsConversation; private ShortcutInfo mShortcutInfo; private @RankingAdjustment int mRankingAdjustment; Loading Loading @@ -1736,7 +1736,7 @@ public abstract class NotificationListenerService extends Service { out.writeTypedList(mSmartActions, flags); out.writeCharSequenceList(mSmartReplies); out.writeBoolean(mCanBubble); out.writeBoolean(mVisuallyInterruptive); out.writeBoolean(mIsTextChanged); out.writeBoolean(mIsConversation); out.writeParcelable(mShortcutInfo, flags); out.writeInt(mRankingAdjustment); Loading Loading @@ -1774,7 +1774,7 @@ public abstract class NotificationListenerService extends Service { mSmartActions = in.createTypedArrayList(Notification.Action.CREATOR); mSmartReplies = in.readCharSequenceList(); mCanBubble = in.readBoolean(); mVisuallyInterruptive = in.readBoolean(); mIsTextChanged = in.readBoolean(); mIsConversation = in.readBoolean(); mShortcutInfo = in.readParcelable(cl); mRankingAdjustment = in.readInt(); Loading Loading @@ -1977,8 +1977,8 @@ public abstract class NotificationListenerService extends Service { } /** @hide */ public boolean visuallyInterruptive() { return mVisuallyInterruptive; public boolean isTextChanged() { return mIsTextChanged; } /** @hide */ Loading Loading @@ -2033,7 +2033,7 @@ public abstract class NotificationListenerService extends Service { int userSentiment, boolean hidden, long lastAudiblyAlertedMs, boolean noisy, ArrayList<Notification.Action> smartActions, ArrayList<CharSequence> smartReplies, boolean canBubble, boolean visuallyInterruptive, boolean isConversation, ShortcutInfo shortcutInfo, boolean isTextChanged, boolean isConversation, ShortcutInfo shortcutInfo, int rankingAdjustment, boolean isBubble) { mKey = key; mRank = rank; Loading @@ -2055,7 +2055,7 @@ public abstract class NotificationListenerService extends Service { mSmartActions = smartActions; mSmartReplies = smartReplies; mCanBubble = canBubble; mVisuallyInterruptive = visuallyInterruptive; mIsTextChanged = isTextChanged; mIsConversation = isConversation; mShortcutInfo = shortcutInfo; mRankingAdjustment = rankingAdjustment; Loading Loading @@ -2096,7 +2096,7 @@ public abstract class NotificationListenerService extends Service { other.mSmartActions, other.mSmartReplies, other.mCanBubble, other.mVisuallyInterruptive, other.mIsTextChanged, other.mIsConversation, other.mShortcutInfo, other.mRankingAdjustment, Loading Loading @@ -2153,7 +2153,7 @@ public abstract class NotificationListenerService extends Service { == (other.mSmartActions == null ? 0 : other.mSmartActions.size())) && Objects.equals(mSmartReplies, other.mSmartReplies) && Objects.equals(mCanBubble, other.mCanBubble) && Objects.equals(mVisuallyInterruptive, other.mVisuallyInterruptive) && Objects.equals(mIsTextChanged, other.mIsTextChanged) && Objects.equals(mIsConversation, other.mIsConversation) // Shortcutinfo doesn't have equals either; use id && Objects.equals((mShortcutInfo == null ? 0 : mShortcutInfo.getId()), Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java +7 −7 Original line number Diff line number Diff line Loading @@ -121,7 +121,7 @@ public class Bubble implements BubbleViewProvider { @Nullable private Icon mIcon; private boolean mIsBubble; private boolean mIsVisuallyInterruptive; private boolean mIsTextChanged; private boolean mIsClearable; private boolean mShouldSuppressNotificationDot; private boolean mShouldSuppressNotificationList; Loading Loading @@ -342,12 +342,12 @@ public class Bubble implements BubbleViewProvider { } /** * Sets whether this bubble is considered visually interruptive. This method is purely for * Sets whether this bubble is considered text changed. This method is purely for * testing. */ @VisibleForTesting void setVisuallyInterruptiveForTest(boolean visuallyInterruptive) { mIsVisuallyInterruptive = visuallyInterruptive; void setTextChangedForTest(boolean textChanged) { mIsTextChanged = textChanged; } /** Loading Loading @@ -454,7 +454,7 @@ public class Bubble implements BubbleViewProvider { mFlyoutMessage = extractFlyoutMessage(entry); if (entry.getRanking() != null) { mShortcutInfo = entry.getRanking().getConversationShortcutInfo(); mIsVisuallyInterruptive = entry.getRanking().visuallyInterruptive(); mIsTextChanged = entry.getRanking().isTextChanged(); if (entry.getRanking().getChannel() != null) { mIsImportantConversation = entry.getRanking().getChannel().isImportantConversation(); Loading Loading @@ -495,8 +495,8 @@ public class Bubble implements BubbleViewProvider { return mIcon; } boolean isVisuallyInterruptive() { return mIsVisuallyInterruptive; boolean isTextChanged() { return mIsTextChanged; } /** Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +1 −1 Original line number Diff line number Diff line Loading @@ -939,7 +939,7 @@ public class BubbleController { public void updateBubble(BubbleEntry notif, boolean suppressFlyout, boolean showInShade) { // If this is an interruptive notif, mark that it's interrupted mSysuiProxy.setNotificationInterruption(notif.getKey()); if (!notif.getRanking().visuallyInterruptive() if (!notif.getRanking().isTextChanged() && (notif.getBubbleMetadata() != null && !notif.getBubbleMetadata().getAutoExpandBubble()) && mBubbleData.hasOverflowBubbleWithKey(notif.getKey())) { Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleData.java +1 −1 Original line number Diff line number Diff line Loading @@ -323,7 +323,7 @@ public class BubbleData { } mPendingBubbles.remove(bubble.getKey()); // No longer pending once we're here Bubble prevBubble = getBubbleInStackWithKey(bubble.getKey()); suppressFlyout |= !bubble.isVisuallyInterruptive(); suppressFlyout |= !bubble.isTextChanged(); if (prevBubble == null) { // Create a new bubble Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubbleDataTest.java +4 −4 Original line number Diff line number Diff line Loading @@ -131,7 +131,7 @@ public class BubbleDataTest extends ShellTestCase { NotificationListenerService.Ranking ranking = mock(NotificationListenerService.Ranking.class); when(ranking.visuallyInterruptive()).thenReturn(true); when(ranking.isTextChanged()).thenReturn(true); mEntryInterruptive = createBubbleEntry(1, "interruptive", "package.d", ranking); mBubbleInterruptive = new Bubble(mEntryInterruptive, mSuppressionListener, null, mMainExecutor); Loading Loading @@ -1014,15 +1014,15 @@ public class BubbleDataTest extends ShellTestCase { } private void sendUpdatedEntryAtTime(BubbleEntry entry, long postTime) { sendUpdatedEntryAtTime(entry, postTime, true /* visuallyInterruptive */); sendUpdatedEntryAtTime(entry, postTime, true /* isTextChanged */); } private void sendUpdatedEntryAtTime(BubbleEntry entry, long postTime, boolean visuallyInterruptive) { boolean textChanged) { setPostTime(entry, postTime); // BubbleController calls this: Bubble b = mBubbleData.getOrCreateBubble(entry, null /* persistedBubble */); b.setVisuallyInterruptiveForTest(visuallyInterruptive); b.setTextChangedForTest(textChanged); // And then this mBubbleData.notificationEntryUpdated(b, false /* suppressFlyout*/, true /* showInShade */); Loading Loading
core/java/android/service/notification/NotificationListenerService.java +9 −9 Original line number Diff line number Diff line Loading @@ -1699,7 +1699,7 @@ public abstract class NotificationListenerService extends Service { private ArrayList<Notification.Action> mSmartActions; private ArrayList<CharSequence> mSmartReplies; private boolean mCanBubble; private boolean mVisuallyInterruptive; private boolean mIsTextChanged; private boolean mIsConversation; private ShortcutInfo mShortcutInfo; private @RankingAdjustment int mRankingAdjustment; Loading Loading @@ -1736,7 +1736,7 @@ public abstract class NotificationListenerService extends Service { out.writeTypedList(mSmartActions, flags); out.writeCharSequenceList(mSmartReplies); out.writeBoolean(mCanBubble); out.writeBoolean(mVisuallyInterruptive); out.writeBoolean(mIsTextChanged); out.writeBoolean(mIsConversation); out.writeParcelable(mShortcutInfo, flags); out.writeInt(mRankingAdjustment); Loading Loading @@ -1774,7 +1774,7 @@ public abstract class NotificationListenerService extends Service { mSmartActions = in.createTypedArrayList(Notification.Action.CREATOR); mSmartReplies = in.readCharSequenceList(); mCanBubble = in.readBoolean(); mVisuallyInterruptive = in.readBoolean(); mIsTextChanged = in.readBoolean(); mIsConversation = in.readBoolean(); mShortcutInfo = in.readParcelable(cl); mRankingAdjustment = in.readInt(); Loading Loading @@ -1977,8 +1977,8 @@ public abstract class NotificationListenerService extends Service { } /** @hide */ public boolean visuallyInterruptive() { return mVisuallyInterruptive; public boolean isTextChanged() { return mIsTextChanged; } /** @hide */ Loading Loading @@ -2033,7 +2033,7 @@ public abstract class NotificationListenerService extends Service { int userSentiment, boolean hidden, long lastAudiblyAlertedMs, boolean noisy, ArrayList<Notification.Action> smartActions, ArrayList<CharSequence> smartReplies, boolean canBubble, boolean visuallyInterruptive, boolean isConversation, ShortcutInfo shortcutInfo, boolean isTextChanged, boolean isConversation, ShortcutInfo shortcutInfo, int rankingAdjustment, boolean isBubble) { mKey = key; mRank = rank; Loading @@ -2055,7 +2055,7 @@ public abstract class NotificationListenerService extends Service { mSmartActions = smartActions; mSmartReplies = smartReplies; mCanBubble = canBubble; mVisuallyInterruptive = visuallyInterruptive; mIsTextChanged = isTextChanged; mIsConversation = isConversation; mShortcutInfo = shortcutInfo; mRankingAdjustment = rankingAdjustment; Loading Loading @@ -2096,7 +2096,7 @@ public abstract class NotificationListenerService extends Service { other.mSmartActions, other.mSmartReplies, other.mCanBubble, other.mVisuallyInterruptive, other.mIsTextChanged, other.mIsConversation, other.mShortcutInfo, other.mRankingAdjustment, Loading Loading @@ -2153,7 +2153,7 @@ public abstract class NotificationListenerService extends Service { == (other.mSmartActions == null ? 0 : other.mSmartActions.size())) && Objects.equals(mSmartReplies, other.mSmartReplies) && Objects.equals(mCanBubble, other.mCanBubble) && Objects.equals(mVisuallyInterruptive, other.mVisuallyInterruptive) && Objects.equals(mIsTextChanged, other.mIsTextChanged) && Objects.equals(mIsConversation, other.mIsConversation) // Shortcutinfo doesn't have equals either; use id && Objects.equals((mShortcutInfo == null ? 0 : mShortcutInfo.getId()), Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java +7 −7 Original line number Diff line number Diff line Loading @@ -121,7 +121,7 @@ public class Bubble implements BubbleViewProvider { @Nullable private Icon mIcon; private boolean mIsBubble; private boolean mIsVisuallyInterruptive; private boolean mIsTextChanged; private boolean mIsClearable; private boolean mShouldSuppressNotificationDot; private boolean mShouldSuppressNotificationList; Loading Loading @@ -342,12 +342,12 @@ public class Bubble implements BubbleViewProvider { } /** * Sets whether this bubble is considered visually interruptive. This method is purely for * Sets whether this bubble is considered text changed. This method is purely for * testing. */ @VisibleForTesting void setVisuallyInterruptiveForTest(boolean visuallyInterruptive) { mIsVisuallyInterruptive = visuallyInterruptive; void setTextChangedForTest(boolean textChanged) { mIsTextChanged = textChanged; } /** Loading Loading @@ -454,7 +454,7 @@ public class Bubble implements BubbleViewProvider { mFlyoutMessage = extractFlyoutMessage(entry); if (entry.getRanking() != null) { mShortcutInfo = entry.getRanking().getConversationShortcutInfo(); mIsVisuallyInterruptive = entry.getRanking().visuallyInterruptive(); mIsTextChanged = entry.getRanking().isTextChanged(); if (entry.getRanking().getChannel() != null) { mIsImportantConversation = entry.getRanking().getChannel().isImportantConversation(); Loading Loading @@ -495,8 +495,8 @@ public class Bubble implements BubbleViewProvider { return mIcon; } boolean isVisuallyInterruptive() { return mIsVisuallyInterruptive; boolean isTextChanged() { return mIsTextChanged; } /** Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +1 −1 Original line number Diff line number Diff line Loading @@ -939,7 +939,7 @@ public class BubbleController { public void updateBubble(BubbleEntry notif, boolean suppressFlyout, boolean showInShade) { // If this is an interruptive notif, mark that it's interrupted mSysuiProxy.setNotificationInterruption(notif.getKey()); if (!notif.getRanking().visuallyInterruptive() if (!notif.getRanking().isTextChanged() && (notif.getBubbleMetadata() != null && !notif.getBubbleMetadata().getAutoExpandBubble()) && mBubbleData.hasOverflowBubbleWithKey(notif.getKey())) { Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleData.java +1 −1 Original line number Diff line number Diff line Loading @@ -323,7 +323,7 @@ public class BubbleData { } mPendingBubbles.remove(bubble.getKey()); // No longer pending once we're here Bubble prevBubble = getBubbleInStackWithKey(bubble.getKey()); suppressFlyout |= !bubble.isVisuallyInterruptive(); suppressFlyout |= !bubble.isTextChanged(); if (prevBubble == null) { // Create a new bubble Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubbleDataTest.java +4 −4 Original line number Diff line number Diff line Loading @@ -131,7 +131,7 @@ public class BubbleDataTest extends ShellTestCase { NotificationListenerService.Ranking ranking = mock(NotificationListenerService.Ranking.class); when(ranking.visuallyInterruptive()).thenReturn(true); when(ranking.isTextChanged()).thenReturn(true); mEntryInterruptive = createBubbleEntry(1, "interruptive", "package.d", ranking); mBubbleInterruptive = new Bubble(mEntryInterruptive, mSuppressionListener, null, mMainExecutor); Loading Loading @@ -1014,15 +1014,15 @@ public class BubbleDataTest extends ShellTestCase { } private void sendUpdatedEntryAtTime(BubbleEntry entry, long postTime) { sendUpdatedEntryAtTime(entry, postTime, true /* visuallyInterruptive */); sendUpdatedEntryAtTime(entry, postTime, true /* isTextChanged */); } private void sendUpdatedEntryAtTime(BubbleEntry entry, long postTime, boolean visuallyInterruptive) { boolean textChanged) { setPostTime(entry, postTime); // BubbleController calls this: Bubble b = mBubbleData.getOrCreateBubble(entry, null /* persistedBubble */); b.setVisuallyInterruptiveForTest(visuallyInterruptive); b.setTextChangedForTest(textChanged); // And then this mBubbleData.notificationEntryUpdated(b, false /* suppressFlyout*/, true /* showInShade */); Loading