summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mady Mellor <madym@google.com> 2023-12-07 16:35:58 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-12-07 16:35:58 +0000
commit03fa255e21a1fbbc3c1b165ffd23173d88199aad (patch)
tree2135ee5e8ebc2e2d78f54a805b0d1b9a5d6fe6f1
parentcfd88e189442a58006e788f364aa0c4cd07b3564 (diff)
parentf146ca64627fac6a740cc15fc1268b80c1e1fab8 (diff)
Merge "Don't keep app bubbles on top" into main
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java2
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubbleDataTest.java16
2 files changed, 17 insertions, 1 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java
index 85ea8097a2c1..7a3210e0a46d 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java
@@ -637,7 +637,7 @@ public class Bubble implements BubbleViewProvider {
* @return the last time this bubble was updated or accessed, whichever is most recent.
*/
long getLastActivity() {
- return isAppBubble() ? Long.MAX_VALUE : Math.max(mLastUpdated, mLastAccessed);
+ return Math.max(mLastUpdated, mLastAccessed);
}
/**
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubbleDataTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubbleDataTest.java
index fad497c981f1..dab762f233e2 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubbleDataTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubbleDataTest.java
@@ -221,6 +221,22 @@ public class BubbleDataTest extends ShellTestCase {
}
@Test
+ public void testAddAppBubble_setsTime() {
+ // Setup
+ mBubbleData.setListener(mListener);
+
+ // Test
+ assertThat(mAppBubble.getLastActivity()).isEqualTo(0);
+ setCurrentTime(1000);
+ mBubbleData.notificationEntryUpdated(mAppBubble, true /* suppressFlyout*/,
+ false /* showInShade */);
+
+ // Verify
+ assertThat(mBubbleData.getBubbleInStackWithKey(mAppBubble.getKey())).isEqualTo(mAppBubble);
+ assertThat(mAppBubble.getLastActivity()).isEqualTo(1000);
+ }
+
+ @Test
public void testRemoveBubble() {
// Setup
sendUpdatedEntryAtTime(mEntryA1, 1000);