summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Liran Binyamin <liranb@google.com> 2023-05-09 18:02:52 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-05-09 18:02:52 +0000
commit386848cb56bd82be43d8872c58ae2fc2ed579a21 (patch)
treeed780baaac35f29e2e0a6f5e976d188c04c9aff4
parent297366d0bae226af0dd26bb21516ae16f2a7c506 (diff)
parent7a693fa4dbff0a20324c6781f6cfa9c8a15cdafa (diff)
Merge "Add a field to BubbleInfo to indicate whether a bubble is important." into udc-dev
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java3
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/common/bubbles/BubbleInfo.java13
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/bubbles/BubbleInfoTest.kt5
3 files changed, 16 insertions, 5 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 e396ba13f154..102f2cb4b8d0 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
@@ -301,7 +301,8 @@ public class Bubble implements BubbleViewProvider {
getIcon(),
getUser().getIdentifier(),
getPackageName(),
- getTitle());
+ getTitle(),
+ isImportantConversation());
}
@Override
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/bubbles/BubbleInfo.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/bubbles/BubbleInfo.java
index baa23e3040c4..21355a3efa2e 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/bubbles/BubbleInfo.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/bubbles/BubbleInfo.java
@@ -30,8 +30,6 @@ import java.util.Objects;
*/
public class BubbleInfo implements Parcelable {
- // TODO(b/269671451): needs whether the bubble is an 'important person' or not
-
private String mKey; // Same key as the Notification
private int mFlags; // Flags from BubbleMetadata
@Nullable
@@ -47,9 +45,11 @@ public class BubbleInfo implements Parcelable {
private Icon mIcon;
@Nullable
private String mTitle;
+ private boolean mIsImportantConversation;
public BubbleInfo(String key, int flags, @Nullable String shortcutId, @Nullable Icon icon,
- int userId, String packageName, @Nullable String title) {
+ int userId, String packageName, @Nullable String title,
+ boolean isImportantConversation) {
mKey = key;
mFlags = flags;
mShortcutId = shortcutId;
@@ -57,6 +57,7 @@ public class BubbleInfo implements Parcelable {
mUserId = userId;
mPackageName = packageName;
mTitle = title;
+ mIsImportantConversation = isImportantConversation;
}
private BubbleInfo(Parcel source) {
@@ -67,6 +68,7 @@ public class BubbleInfo implements Parcelable {
mUserId = source.readInt();
mPackageName = source.readString();
mTitle = source.readString();
+ mIsImportantConversation = source.readBoolean();
}
public String getKey() {
@@ -100,6 +102,10 @@ public class BubbleInfo implements Parcelable {
return mTitle;
}
+ public boolean isImportantConversation() {
+ return mIsImportantConversation;
+ }
+
/**
* Whether this bubble is currently being hidden from the stack.
*/
@@ -150,6 +156,7 @@ public class BubbleInfo implements Parcelable {
parcel.writeInt(mUserId);
parcel.writeString(mPackageName);
parcel.writeString(mTitle);
+ parcel.writeBoolean(mIsImportantConversation);
}
@NonNull
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/bubbles/BubbleInfoTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/bubbles/BubbleInfoTest.kt
index 8fbac1db8653..432909f18813 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/bubbles/BubbleInfoTest.kt
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/bubbles/BubbleInfoTest.kt
@@ -31,7 +31,8 @@ class BubbleInfoTest : ShellTestCase() {
@Test
fun bubbleInfo() {
- val bubbleInfo = BubbleInfo("key", 0, "shortcut id", null, 6, "com.some.package", "title")
+ val bubbleInfo =
+ BubbleInfo("key", 0, "shortcut id", null, 6, "com.some.package", "title", true)
val parcel = Parcel.obtain()
bubbleInfo.writeToParcel(parcel, PARCELABLE_WRITE_RETURN_VALUE)
parcel.setDataPosition(0)
@@ -45,5 +46,7 @@ class BubbleInfoTest : ShellTestCase() {
assertThat(bubbleInfo.userId).isEqualTo(bubbleInfoFromParcel.userId)
assertThat(bubbleInfo.packageName).isEqualTo(bubbleInfoFromParcel.packageName)
assertThat(bubbleInfo.title).isEqualTo(bubbleInfoFromParcel.title)
+ assertThat(bubbleInfo.isImportantConversation)
+ .isEqualTo(bubbleInfoFromParcel.isImportantConversation)
}
}