Loading core/java/android/window/WindowContainerTransaction.java +34 −0 Original line number Diff line number Diff line Loading @@ -225,6 +225,19 @@ public final class WindowContainerTransaction implements Parcelable { return this; } /** * Sets whether the container should launch next as Bubble * @hide */ @NonNull public WindowContainerTransaction setLaunchNextToBubble( @NonNull WindowContainerToken container, boolean launchNextToBubble) { final Change chg = getOrCreateChange(container.asBinder()); chg.mLaunchNextToBubble = launchNextToBubble; chg.mChangeMask |= Change.CHANGE_LAUNCH_NEXT_TO_BUBBLE; return this; } /** * Sets whether a container or any of its children can be focusable. When {@code false}, no * child can be focused; however, when {@code true}, it is still possible for children to be Loading Loading @@ -1341,6 +1354,7 @@ public final class WindowContainerTransaction implements Parcelable { public static final int CHANGE_DRAG_RESIZING = 1 << 7; public static final int CHANGE_RELATIVE_BOUNDS = 1 << 8; public static final int CHANGE_FORCE_EXCLUDED_FROM_RECENTS = 1 << 9; public static final int CHANGE_LAUNCH_NEXT_TO_BUBBLE = 1 << 10; @IntDef(flag = true, prefix = { "CHANGE_" }, value = { CHANGE_FOCUSABLE, Loading @@ -1353,6 +1367,7 @@ public final class WindowContainerTransaction implements Parcelable { CHANGE_DRAG_RESIZING, CHANGE_RELATIVE_BOUNDS, CHANGE_FORCE_EXCLUDED_FROM_RECENTS, CHANGE_LAUNCH_NEXT_TO_BUBBLE, }) @Retention(RetentionPolicy.SOURCE) public @interface ChangeMask {} Loading @@ -1377,6 +1392,8 @@ public final class WindowContainerTransaction implements Parcelable { private int mActivityWindowingMode = -1; private int mWindowingMode = -1; private boolean mLaunchNextToBubble = false; private Change() {} private Change(@NonNull Parcel in) { Loading @@ -1402,6 +1419,7 @@ public final class WindowContainerTransaction implements Parcelable { mWindowingMode = in.readInt(); mActivityWindowingMode = in.readInt(); mLaunchNextToBubble = in.readBoolean(); } /** Loading Loading @@ -1435,6 +1453,9 @@ public final class WindowContainerTransaction implements Parcelable { if ((other.mChangeMask & CHANGE_FORCE_EXCLUDED_FROM_RECENTS) != 0) { mForceExcludedFromRecents = other.mForceExcludedFromRecents; } if ((other.mChangeMask & CHANGE_LAUNCH_NEXT_TO_BUBBLE) != 0) { mLaunchNextToBubble = other.mLaunchNextToBubble; } mChangeMask |= other.mChangeMask; if (other.mActivityWindowingMode >= WINDOWING_MODE_UNDEFINED) { mActivityWindowingMode = other.mActivityWindowingMode; Loading Loading @@ -1464,6 +1485,15 @@ public final class WindowContainerTransaction implements Parcelable { return mConfiguration; } /** Gets the requested mLaunchNextToBubble state */ public boolean getLaunchNextToBubble() { if ((mChangeMask & CHANGE_LAUNCH_NEXT_TO_BUBBLE) == 0) { throw new RuntimeException( "mLaunchNextToBubble not set. check CHANGE_LAUNCH_NEXT_TO_BUBBLE first"); } return mLaunchNextToBubble; } /** Gets the requested focusable state */ public boolean getFocusable() { if ((mChangeMask & CHANGE_FOCUSABLE) == 0) { Loading Loading @@ -1598,6 +1628,9 @@ public final class WindowContainerTransaction implements Parcelable { if ((mChangeMask & CHANGE_RELATIVE_BOUNDS) != 0) { sb.append("relativeBounds:").append(mRelativeBounds).append(","); } if ((mChangeMask & CHANGE_LAUNCH_NEXT_TO_BUBBLE) != 0) { sb.append("launchNextToBubble:").append(mLaunchNextToBubble).append(","); } if (mConfigAtTransitionEnd) { sb.append("configAtTransitionEnd").append(","); } Loading Loading @@ -1628,6 +1661,7 @@ public final class WindowContainerTransaction implements Parcelable { dest.writeInt(mWindowingMode); dest.writeInt(mActivityWindowingMode); dest.writeBoolean(mLaunchNextToBubble); } @Override Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java +2 −2 Original line number Diff line number Diff line Loading @@ -249,7 +249,7 @@ public class BubbleExpandedView extends LinearLayout { // Needs to be mutable for the fillInIntent PendingIntent.FLAG_MUTABLE | PendingIntent.FLAG_UPDATE_CURRENT, /* options= */ null); options.setLaunchNextToBubble(true); options.setLaunchNextToBubble(true /* launchNextToBubble */); mTaskView.startActivity(pi, fillInIntent, options, launchBounds); } else if (!mIsOverflow && isShortcutBubble) { ProtoLog.v(WM_SHELL_BUBBLES, "startingShortcutBubble=%s", getBubbleKey()); Loading @@ -257,7 +257,7 @@ public class BubbleExpandedView extends LinearLayout { options.setLaunchedFromBubble(true); options.setApplyActivityFlagsForBubbles(true); } else { options.setLaunchNextToBubble(true); options.setLaunchNextToBubble(true /* launchNextToBubble */); options.setApplyMultipleTaskFlagForShortcut(true); } mTaskView.startShortcutActivity(mBubble.getShortcutInfo(), Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleTaskStackListener.kt +1 −0 Original line number Diff line number Diff line Loading @@ -138,6 +138,7 @@ class BubbleTaskStackListener( val wct = WindowContainerTransaction() wct.setTaskForceExcludedFromRecents(task.token, false /* forceExcluded */) .setLaunchNextToBubble(task.token, false /* launchNextToBubble */) taskOrganizer.applyTransaction(wct) taskOrganizer.setInterceptBackPressedOnTaskRoot(task.token, false /* intercept */) Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleTaskViewListener.java +2 −2 Original line number Diff line number Diff line Loading @@ -144,14 +144,14 @@ public class BubbleTaskViewListener implements TaskView.Listener { PendingIntent.FLAG_MUTABLE | PendingIntent.FLAG_UPDATE_CURRENT, /* options= */ null); } options.setLaunchNextToBubble(true); options.setLaunchNextToBubble(true /* launchNextToBubble */); mTaskView.startActivity(pi, fillInIntent, options, launchBounds); } else if (isShortcutBubble) { if (mBubble.isChat()) { options.setLaunchedFromBubble(true); options.setApplyActivityFlagsForBubbles(true); } else { options.setLaunchNextToBubble(true); options.setLaunchNextToBubble(true /* launchNextToBubble */); options.setApplyMultipleTaskFlagForShortcut(true); } mTaskView.startShortcutActivity(mBubble.getShortcutInfo(), Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleTransitions.java +3 −0 Original line number Diff line number Diff line Loading @@ -295,6 +295,7 @@ public class BubbleTransitions { } wct.setAlwaysOnTop(mTaskInfo.token, true /* alwaysOnTop */); wct.setLaunchNextToBubble(mTaskInfo.token, true /* launchNextToBubble */); if (com.android.window.flags.Flags.excludeTaskFromRecents()) { wct.setTaskForceExcludedFromRecents(mTaskInfo.token, true /* forceExcluded */); } Loading Loading @@ -533,6 +534,7 @@ public class BubbleTransitions { final WindowContainerToken token = mTaskInfo.getToken(); wct.setWindowingMode(token, WINDOWING_MODE_UNDEFINED); wct.setAlwaysOnTop(token, false /* alwaysOnTop */); wct.setLaunchNextToBubble(token, false /* launchNextToBubble */); if (com.android.window.flags.Flags.excludeTaskFromRecents()) { wct.setTaskForceExcludedFromRecents(token, false /* forceExcluded */); } Loading Loading @@ -696,6 +698,7 @@ public class BubbleTransitions { final WindowContainerToken token = bubble.getTaskView().getTaskInfo().getToken(); final WindowContainerTransaction wct = new WindowContainerTransaction(); wct.setAlwaysOnTop(token, false /* alwaysOnTop */); wct.setLaunchNextToBubble(token, false /* launchNextToBubble */); if (com.android.window.flags.Flags.excludeTaskFromRecents()) { wct.setTaskForceExcludedFromRecents(token, false /* forceExcluded */); } Loading Loading
core/java/android/window/WindowContainerTransaction.java +34 −0 Original line number Diff line number Diff line Loading @@ -225,6 +225,19 @@ public final class WindowContainerTransaction implements Parcelable { return this; } /** * Sets whether the container should launch next as Bubble * @hide */ @NonNull public WindowContainerTransaction setLaunchNextToBubble( @NonNull WindowContainerToken container, boolean launchNextToBubble) { final Change chg = getOrCreateChange(container.asBinder()); chg.mLaunchNextToBubble = launchNextToBubble; chg.mChangeMask |= Change.CHANGE_LAUNCH_NEXT_TO_BUBBLE; return this; } /** * Sets whether a container or any of its children can be focusable. When {@code false}, no * child can be focused; however, when {@code true}, it is still possible for children to be Loading Loading @@ -1341,6 +1354,7 @@ public final class WindowContainerTransaction implements Parcelable { public static final int CHANGE_DRAG_RESIZING = 1 << 7; public static final int CHANGE_RELATIVE_BOUNDS = 1 << 8; public static final int CHANGE_FORCE_EXCLUDED_FROM_RECENTS = 1 << 9; public static final int CHANGE_LAUNCH_NEXT_TO_BUBBLE = 1 << 10; @IntDef(flag = true, prefix = { "CHANGE_" }, value = { CHANGE_FOCUSABLE, Loading @@ -1353,6 +1367,7 @@ public final class WindowContainerTransaction implements Parcelable { CHANGE_DRAG_RESIZING, CHANGE_RELATIVE_BOUNDS, CHANGE_FORCE_EXCLUDED_FROM_RECENTS, CHANGE_LAUNCH_NEXT_TO_BUBBLE, }) @Retention(RetentionPolicy.SOURCE) public @interface ChangeMask {} Loading @@ -1377,6 +1392,8 @@ public final class WindowContainerTransaction implements Parcelable { private int mActivityWindowingMode = -1; private int mWindowingMode = -1; private boolean mLaunchNextToBubble = false; private Change() {} private Change(@NonNull Parcel in) { Loading @@ -1402,6 +1419,7 @@ public final class WindowContainerTransaction implements Parcelable { mWindowingMode = in.readInt(); mActivityWindowingMode = in.readInt(); mLaunchNextToBubble = in.readBoolean(); } /** Loading Loading @@ -1435,6 +1453,9 @@ public final class WindowContainerTransaction implements Parcelable { if ((other.mChangeMask & CHANGE_FORCE_EXCLUDED_FROM_RECENTS) != 0) { mForceExcludedFromRecents = other.mForceExcludedFromRecents; } if ((other.mChangeMask & CHANGE_LAUNCH_NEXT_TO_BUBBLE) != 0) { mLaunchNextToBubble = other.mLaunchNextToBubble; } mChangeMask |= other.mChangeMask; if (other.mActivityWindowingMode >= WINDOWING_MODE_UNDEFINED) { mActivityWindowingMode = other.mActivityWindowingMode; Loading Loading @@ -1464,6 +1485,15 @@ public final class WindowContainerTransaction implements Parcelable { return mConfiguration; } /** Gets the requested mLaunchNextToBubble state */ public boolean getLaunchNextToBubble() { if ((mChangeMask & CHANGE_LAUNCH_NEXT_TO_BUBBLE) == 0) { throw new RuntimeException( "mLaunchNextToBubble not set. check CHANGE_LAUNCH_NEXT_TO_BUBBLE first"); } return mLaunchNextToBubble; } /** Gets the requested focusable state */ public boolean getFocusable() { if ((mChangeMask & CHANGE_FOCUSABLE) == 0) { Loading Loading @@ -1598,6 +1628,9 @@ public final class WindowContainerTransaction implements Parcelable { if ((mChangeMask & CHANGE_RELATIVE_BOUNDS) != 0) { sb.append("relativeBounds:").append(mRelativeBounds).append(","); } if ((mChangeMask & CHANGE_LAUNCH_NEXT_TO_BUBBLE) != 0) { sb.append("launchNextToBubble:").append(mLaunchNextToBubble).append(","); } if (mConfigAtTransitionEnd) { sb.append("configAtTransitionEnd").append(","); } Loading Loading @@ -1628,6 +1661,7 @@ public final class WindowContainerTransaction implements Parcelable { dest.writeInt(mWindowingMode); dest.writeInt(mActivityWindowingMode); dest.writeBoolean(mLaunchNextToBubble); } @Override Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java +2 −2 Original line number Diff line number Diff line Loading @@ -249,7 +249,7 @@ public class BubbleExpandedView extends LinearLayout { // Needs to be mutable for the fillInIntent PendingIntent.FLAG_MUTABLE | PendingIntent.FLAG_UPDATE_CURRENT, /* options= */ null); options.setLaunchNextToBubble(true); options.setLaunchNextToBubble(true /* launchNextToBubble */); mTaskView.startActivity(pi, fillInIntent, options, launchBounds); } else if (!mIsOverflow && isShortcutBubble) { ProtoLog.v(WM_SHELL_BUBBLES, "startingShortcutBubble=%s", getBubbleKey()); Loading @@ -257,7 +257,7 @@ public class BubbleExpandedView extends LinearLayout { options.setLaunchedFromBubble(true); options.setApplyActivityFlagsForBubbles(true); } else { options.setLaunchNextToBubble(true); options.setLaunchNextToBubble(true /* launchNextToBubble */); options.setApplyMultipleTaskFlagForShortcut(true); } mTaskView.startShortcutActivity(mBubble.getShortcutInfo(), Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleTaskStackListener.kt +1 −0 Original line number Diff line number Diff line Loading @@ -138,6 +138,7 @@ class BubbleTaskStackListener( val wct = WindowContainerTransaction() wct.setTaskForceExcludedFromRecents(task.token, false /* forceExcluded */) .setLaunchNextToBubble(task.token, false /* launchNextToBubble */) taskOrganizer.applyTransaction(wct) taskOrganizer.setInterceptBackPressedOnTaskRoot(task.token, false /* intercept */) Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleTaskViewListener.java +2 −2 Original line number Diff line number Diff line Loading @@ -144,14 +144,14 @@ public class BubbleTaskViewListener implements TaskView.Listener { PendingIntent.FLAG_MUTABLE | PendingIntent.FLAG_UPDATE_CURRENT, /* options= */ null); } options.setLaunchNextToBubble(true); options.setLaunchNextToBubble(true /* launchNextToBubble */); mTaskView.startActivity(pi, fillInIntent, options, launchBounds); } else if (isShortcutBubble) { if (mBubble.isChat()) { options.setLaunchedFromBubble(true); options.setApplyActivityFlagsForBubbles(true); } else { options.setLaunchNextToBubble(true); options.setLaunchNextToBubble(true /* launchNextToBubble */); options.setApplyMultipleTaskFlagForShortcut(true); } mTaskView.startShortcutActivity(mBubble.getShortcutInfo(), Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleTransitions.java +3 −0 Original line number Diff line number Diff line Loading @@ -295,6 +295,7 @@ public class BubbleTransitions { } wct.setAlwaysOnTop(mTaskInfo.token, true /* alwaysOnTop */); wct.setLaunchNextToBubble(mTaskInfo.token, true /* launchNextToBubble */); if (com.android.window.flags.Flags.excludeTaskFromRecents()) { wct.setTaskForceExcludedFromRecents(mTaskInfo.token, true /* forceExcluded */); } Loading Loading @@ -533,6 +534,7 @@ public class BubbleTransitions { final WindowContainerToken token = mTaskInfo.getToken(); wct.setWindowingMode(token, WINDOWING_MODE_UNDEFINED); wct.setAlwaysOnTop(token, false /* alwaysOnTop */); wct.setLaunchNextToBubble(token, false /* launchNextToBubble */); if (com.android.window.flags.Flags.excludeTaskFromRecents()) { wct.setTaskForceExcludedFromRecents(token, false /* forceExcluded */); } Loading Loading @@ -696,6 +698,7 @@ public class BubbleTransitions { final WindowContainerToken token = bubble.getTaskView().getTaskInfo().getToken(); final WindowContainerTransaction wct = new WindowContainerTransaction(); wct.setAlwaysOnTop(token, false /* alwaysOnTop */); wct.setLaunchNextToBubble(token, false /* launchNextToBubble */); if (com.android.window.flags.Flags.excludeTaskFromRecents()) { wct.setTaskForceExcludedFromRecents(token, false /* forceExcluded */); } Loading