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

Commit 1fbcfd73 authored by Louis Chang's avatar Louis Chang
Browse files

Add isAppBubble in TaskInfo

Bug: 388651207
Test: wm presubmit
Flag: com.android.wm.shell.enable_create_any_bubble
Change-Id: Id77cf0bdb2e741d0407283c4163abdf7b5a2319f
parent 476a1203
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -357,6 +357,14 @@ public class TaskInfo {
     */
    public AppCompatTaskInfo appCompatTaskInfo = AppCompatTaskInfo.create();

    /**
     * Whether the Task should be an App Bubble.
     * Please use this with caution. This is just a short-term solution which should be migrated
     * to a more generic model vs. implying the Task is an App Bubble here.
     * @hide
     */
    public boolean isAppBubble;

    /**
     * The top activity's main window frame if it doesn't match the top activity bounds.
     * {@code null}, otherwise.
@@ -511,7 +519,8 @@ public class TaskInfo {
                && topActivityRequestOpenInBrowserEducationTimestamp
                    == that.topActivityRequestOpenInBrowserEducationTimestamp
                && appCompatTaskInfo.equalsForTaskOrganizer(that.appCompatTaskInfo)
                && Objects.equals(topActivityMainWindowFrame, that.topActivityMainWindowFrame);
                && Objects.equals(topActivityMainWindowFrame, that.topActivityMainWindowFrame)
                && isAppBubble == that.isAppBubble;
    }

    /**
@@ -590,6 +599,7 @@ public class TaskInfo {
        topActivityRequestOpenInBrowserEducationTimestamp = source.readLong();
        appCompatTaskInfo = source.readTypedObject(AppCompatTaskInfo.CREATOR);
        topActivityMainWindowFrame = source.readTypedObject(Rect.CREATOR);
        isAppBubble = source.readBoolean();
    }

    /**
@@ -647,6 +657,7 @@ public class TaskInfo {
        dest.writeLong(topActivityRequestOpenInBrowserEducationTimestamp);
        dest.writeTypedObject(appCompatTaskInfo, flags);
        dest.writeTypedObject(topActivityMainWindowFrame, flags);
        dest.writeBoolean(isAppBubble);
    }

    @Override
@@ -696,6 +707,7 @@ public class TaskInfo {
                + topActivityRequestOpenInBrowserEducationTimestamp
                + " appCompatTaskInfo=" + appCompatTaskInfo
                + " topActivityMainWindowFrame=" + topActivityMainWindowFrame
                + " isAppBubble=" + isAppBubble
                + "}";
    }
}
+2 −0
Original line number Diff line number Diff line
@@ -3416,6 +3416,8 @@ class Task extends TaskFragment {
                        : WindowInsets.Type.defaultVisible();
        AppCompatUtils.fillAppCompatTaskInfo(this, info, top);
        info.topActivityMainWindowFrame = calculateTopActivityMainWindowFrameForTaskInfo(top);
        // If new Tasks launched from this Task should be Bubble, this should also be a Bubble.
        info.isAppBubble = mLaunchNextToBubble;
    }

    /**