Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0108a504 authored by Ats Jenk's avatar Ats Jenk
Browse files

Send app name to launcher

Include app name in bubble info that is sent to launcher.
It will be used to create a content description for the bubble.

Bug: 344670947
Flag: com.android.wm.shell.enable_bubble_bar
Test: atest WMShellUnitTests
Change-Id: I9e5b537912539d556e40407ceef5faf4d62ca9b2
parent 106560ec
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -305,6 +305,7 @@ public class Bubble implements BubbleViewProvider {
                getUser().getIdentifier(),
                getPackageName(),
                getTitle(),
                getAppName(),
                isImportantConversation());
    }

+11 −1
Original line number Diff line number Diff line
@@ -45,10 +45,12 @@ public class BubbleInfo implements Parcelable {
    private Icon mIcon;
    @Nullable
    private String mTitle;
    @Nullable
    private String mAppName;
    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, @Nullable String appName,
            boolean isImportantConversation) {
        mKey = key;
        mFlags = flags;
@@ -57,6 +59,7 @@ public class BubbleInfo implements Parcelable {
        mUserId = userId;
        mPackageName = packageName;
        mTitle = title;
        mAppName = appName;
        mIsImportantConversation = isImportantConversation;
    }

@@ -68,6 +71,7 @@ public class BubbleInfo implements Parcelable {
        mUserId = source.readInt();
        mPackageName = source.readString();
        mTitle = source.readString();
        mAppName = source.readString();
        mIsImportantConversation = source.readBoolean();
    }

@@ -102,6 +106,11 @@ public class BubbleInfo implements Parcelable {
        return mTitle;
    }

    @Nullable
    public String getAppName() {
        return mAppName;
    }

    public boolean isImportantConversation() {
        return mIsImportantConversation;
    }
@@ -161,6 +170,7 @@ public class BubbleInfo implements Parcelable {
        parcel.writeInt(mUserId);
        parcel.writeString(mPackageName);
        parcel.writeString(mTitle);
        parcel.writeString(mAppName);
        parcel.writeBoolean(mIsImportantConversation);
    }

+12 −1
Original line number Diff line number Diff line
@@ -32,7 +32,17 @@ class BubbleInfoTest : ShellTestCase() {
    @Test
    fun bubbleInfo() {
        val bubbleInfo =
            BubbleInfo("key", 0, "shortcut id", null, 6, "com.some.package", "title", true)
            BubbleInfo(
                "key",
                0,
                "shortcut id",
                null,
                6,
                "com.some.package",
                "title",
                "Some app",
                true
            )
        val parcel = Parcel.obtain()
        bubbleInfo.writeToParcel(parcel, PARCELABLE_WRITE_RETURN_VALUE)
        parcel.setDataPosition(0)
@@ -46,6 +56,7 @@ class BubbleInfoTest : ShellTestCase() {
        assertThat(bubbleInfo.userId).isEqualTo(bubbleInfoFromParcel.userId)
        assertThat(bubbleInfo.packageName).isEqualTo(bubbleInfoFromParcel.packageName)
        assertThat(bubbleInfo.title).isEqualTo(bubbleInfoFromParcel.title)
        assertThat(bubbleInfo.appName).isEqualTo(bubbleInfoFromParcel.appName)
        assertThat(bubbleInfo.isImportantConversation)
            .isEqualTo(bubbleInfoFromParcel.isImportantConversation)
    }