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

Commit 9ab45eb9 authored by Mady Mellor's avatar Mady Mellor
Browse files

Add a bit to bubble info to indicate if the app badge should be shown

For the "anything can bubble" prototype we show the app icon as the
bubble icon and the extra badge looks weird. Launcher will use this
bit to hide the badge in this scenario.

Flag: com.android.wm.shell.enable_bubble_anything
Test: manual - add an app bubble to bubble bar, observe it's not
               badged (with launcher CL)
Bug: 342245211
Change-Id: Ib474e4d565e1833bdf102655466d8be8bb0544db
parent 88f1c7e6
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -349,7 +349,8 @@ public class Bubble implements BubbleViewProvider {
                getPackageName(),
                getTitle(),
                getAppName(),
                isImportantConversation());
                isImportantConversation(),
                !isAppLaunchIntent());
    }

    @Override
+9 −1
Original line number Diff line number Diff line
@@ -48,10 +48,11 @@ public class BubbleInfo implements Parcelable {
    @Nullable
    private String mAppName;
    private boolean mIsImportantConversation;
    private boolean mShowAppBadge;

    public BubbleInfo(String key, int flags, @Nullable String shortcutId, @Nullable Icon icon,
            int userId, String packageName, @Nullable String title, @Nullable String appName,
            boolean isImportantConversation) {
            boolean isImportantConversation, boolean showAppBadge) {
        mKey = key;
        mFlags = flags;
        mShortcutId = shortcutId;
@@ -61,6 +62,7 @@ public class BubbleInfo implements Parcelable {
        mTitle = title;
        mAppName = appName;
        mIsImportantConversation = isImportantConversation;
        mShowAppBadge = showAppBadge;
    }

    private BubbleInfo(Parcel source) {
@@ -73,6 +75,7 @@ public class BubbleInfo implements Parcelable {
        mTitle = source.readString();
        mAppName = source.readString();
        mIsImportantConversation = source.readBoolean();
        mShowAppBadge = source.readBoolean();
    }

    public String getKey() {
@@ -115,6 +118,10 @@ public class BubbleInfo implements Parcelable {
        return mIsImportantConversation;
    }

    public boolean showAppBadge() {
        return mShowAppBadge;
    }

    /**
     * Whether this bubble is currently being hidden from the stack.
     */
@@ -172,6 +179,7 @@ public class BubbleInfo implements Parcelable {
        parcel.writeString(mTitle);
        parcel.writeString(mAppName);
        parcel.writeBoolean(mIsImportantConversation);
        parcel.writeBoolean(mShowAppBadge);
    }

    @NonNull
+1 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ class BubbleInfoTest : ShellTestCase() {
                "com.some.package",
                "title",
                "Some app",
                true,
                true
            )
        val parcel = Parcel.obtain()