Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +5 −0 Original line number Diff line number Diff line Loading @@ -652,6 +652,11 @@ public class BubbleController implements ConfigurationChangeListener, wct.reorder(taskInfo.token, false /* onTop */); wct.setInterceptBackPressedOnTaskRoot(taskInfo.token, true /* interceptBackPressed */); wct.setTaskForceExcludedFromRecents(taskInfo.token, true /* forceExcluded */); wct.setDisablePip(taskInfo.token, true /* disablePip */); wct.setDisableLaunchAdjacent(taskInfo.token, true /* disableLaunchAdjacent */); mTaskOrganizer.applyTransaction(wct); } }); Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleTaskViewListener.java +4 −1 Original line number Diff line number Diff line Loading @@ -228,8 +228,11 @@ public class BubbleTaskViewListener implements TaskView.Listener { final TaskViewTaskController tvc = mTaskView.getController(); final boolean isAppBubble = mBubble != null && (mBubble.isApp() || mBubble.isShortcut()); Rect launchBounds = new Rect(); mTaskView.getBoundsOnScreen(launchBounds); final WindowContainerTransaction wct = getEnterBubbleTransaction( tvc.getTaskToken(), mExpandedViewManager.getAppBubbleRootTaskToken(), isAppBubble); tvc.getTaskToken(), mExpandedViewManager.getAppBubbleRootTaskToken(), launchBounds, isAppBubble); tvc.getTaskOrganizer().applyTransaction(wct); // With the task org, the taskAppeared callback will only happen once the task has Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleTransitions.java +2 −2 Original line number Diff line number Diff line Loading @@ -1152,8 +1152,8 @@ public class BubbleTransitions { } else { opts.setTaskAlwaysOnTop(true); opts.setLaunchNextToBubble(true); } opts.setLaunchWindowingMode(WINDOWING_MODE_MULTI_WINDOW); } opts.setLaunchBounds(launchBounds); // TODO(b/437451940): start the pending intent or shortcut via WCT if (mBubble.isShortcut()) { Loading Loading @@ -1484,7 +1484,7 @@ public class BubbleTransitions { mTaskInfo.getWindowingMode() == WINDOWING_MODE_MULTI_WINDOW && mTaskInfo.getParentTaskId() != INVALID_TASK_ID; final WindowContainerTransaction wct = getEnterBubbleTransaction( mTaskInfo.token, mBubbleController.getAppBubbleRootTaskToken(), mTaskInfo.token, mBubbleController.getAppBubbleRootTaskToken(), launchBounds, true /* isAppBubble */, reparentToTda); mHomeIntentProvider.addLaunchHomePendingIntent(wct, mTaskInfo.displayId, mTaskInfo.userId); Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/util/BubbleUtils.kt +10 −4 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ object BubbleUtils { private fun getBubbleTransaction( token: WindowContainerToken, rootToken: WindowContainerToken?, bounds: Rect, toBubble: Boolean, isAppBubble: Boolean, reparentToTda: Boolean, Loading @@ -47,6 +48,7 @@ object BubbleUtils { if (BubbleAnythingFlagHelper.enableRootTaskForBubble() && isAppBubble) { if (toBubble && rootToken != null) { wct.reparent(token, rootToken, true /* onTop */) wct.setBounds(rootToken, bounds) wct.setAlwaysOnTop(rootToken, true /* alwaysOnTop */) } else { wct.reparent(token, null, true /* onTop */) Loading @@ -65,6 +67,8 @@ object BubbleUtils { WindowConfiguration.WINDOWING_MODE_UNDEFINED, ) wct.setInterceptBackPressedOnTaskRoot(token, toBubble) wct.setTaskForceExcludedFromRecents(token, toBubble /* forceExcluded */) wct.setDisablePip(token, toBubble /* disablePip */) if (!isAppBubble || !BubbleAnythingFlagHelper.enableRootTaskForBubble()) { wct.setAlwaysOnTop(token, toBubble /* alwaysOnTop */) } Loading @@ -74,12 +78,11 @@ object BubbleUtils { // Always reset everything when exit bubble. wct.setLaunchNextToBubble(token, toBubble /* launchNextToBubble */) } } // TODO: b/407669465 - review if those could also be set on the bubble root task. wct.setTaskForceExcludedFromRecents(token, toBubble /* forceExcluded */) wct.setDisablePip(token, toBubble /* disablePip */) if (BubbleAnythingFlagHelper.enableCreateAnyBubble()) { wct.setDisableLaunchAdjacent(token, toBubble /* disableLaunchAdjacent */) } } if (BubbleAnythingFlagHelper.enableCreateAnyBubble()) { if (!toBubble) { // Clear bounds if moving out of Bubble. wct.setBounds(token, Rect()) Loading Loading @@ -108,12 +111,14 @@ object BubbleUtils { fun getEnterBubbleTransaction( token: WindowContainerToken, rootToken: WindowContainerToken?, bounds: Rect, isAppBubble: Boolean, reparentToTda: Boolean = false, ): WindowContainerTransaction { return getBubbleTransaction( token, rootToken, bounds, toBubble = true, isAppBubble, reparentToTda, Loading @@ -133,6 +138,7 @@ object BubbleUtils { return getBubbleTransaction( token, rootToken = null, bounds = Rect(), toBubble = false, // Everything will be reset, so doesn't matter for exit. isAppBubble = true, Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/util/BubbleUtilsTest.kt +5 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.wm.shell.bubbles.util import android.graphics.Rect import android.os.Binder import android.platform.test.annotations.DisableFlags import android.platform.test.annotations.EnableFlags Loading Loading @@ -52,6 +53,7 @@ class BubbleUtilsTest : ShellTestCase() { private val rootTaskToken = mock<WindowContainerToken> { on { asBinder() } doReturn binder } private val bounds = Rect(0, 0, 100, 100) private val captionInsetsOwner = Binder() @EnableFlags(FLAG_ENABLE_CREATE_ANY_BUBBLE) Loading @@ -59,7 +61,7 @@ class BubbleUtilsTest : ShellTestCase() { @Test fun testGetEnterBubbleTransaction(@TestParameter isAppBubble: Boolean) { val wctWithLaunchNextToBubble = getEnterBubbleTransaction(token, null /* rootToken */, isAppBubble) getEnterBubbleTransaction(token, null /* rootToken */, bounds, isAppBubble) verifyEnterBubbleTransaction(wctWithLaunchNextToBubble, token.asBinder(), isAppBubble) } Loading @@ -72,6 +74,7 @@ class BubbleUtilsTest : ShellTestCase() { getEnterBubbleTransaction( token, rootToken = null, bounds, isAppBubble, reparentToTda = true ) Loading @@ -88,7 +91,7 @@ class BubbleUtilsTest : ShellTestCase() { @Test fun testRootBubbleGetEnterBubbleTransaction() { val isAppBubble = true val wct = getEnterBubbleTransaction(token, rootTaskToken, isAppBubble) val wct = getEnterBubbleTransaction(token, rootTaskToken, bounds, isAppBubble) verifyEnterBubbleTransaction( wct, Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +5 −0 Original line number Diff line number Diff line Loading @@ -652,6 +652,11 @@ public class BubbleController implements ConfigurationChangeListener, wct.reorder(taskInfo.token, false /* onTop */); wct.setInterceptBackPressedOnTaskRoot(taskInfo.token, true /* interceptBackPressed */); wct.setTaskForceExcludedFromRecents(taskInfo.token, true /* forceExcluded */); wct.setDisablePip(taskInfo.token, true /* disablePip */); wct.setDisableLaunchAdjacent(taskInfo.token, true /* disableLaunchAdjacent */); mTaskOrganizer.applyTransaction(wct); } }); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleTaskViewListener.java +4 −1 Original line number Diff line number Diff line Loading @@ -228,8 +228,11 @@ public class BubbleTaskViewListener implements TaskView.Listener { final TaskViewTaskController tvc = mTaskView.getController(); final boolean isAppBubble = mBubble != null && (mBubble.isApp() || mBubble.isShortcut()); Rect launchBounds = new Rect(); mTaskView.getBoundsOnScreen(launchBounds); final WindowContainerTransaction wct = getEnterBubbleTransaction( tvc.getTaskToken(), mExpandedViewManager.getAppBubbleRootTaskToken(), isAppBubble); tvc.getTaskToken(), mExpandedViewManager.getAppBubbleRootTaskToken(), launchBounds, isAppBubble); tvc.getTaskOrganizer().applyTransaction(wct); // With the task org, the taskAppeared callback will only happen once the task has Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleTransitions.java +2 −2 Original line number Diff line number Diff line Loading @@ -1152,8 +1152,8 @@ public class BubbleTransitions { } else { opts.setTaskAlwaysOnTop(true); opts.setLaunchNextToBubble(true); } opts.setLaunchWindowingMode(WINDOWING_MODE_MULTI_WINDOW); } opts.setLaunchBounds(launchBounds); // TODO(b/437451940): start the pending intent or shortcut via WCT if (mBubble.isShortcut()) { Loading Loading @@ -1484,7 +1484,7 @@ public class BubbleTransitions { mTaskInfo.getWindowingMode() == WINDOWING_MODE_MULTI_WINDOW && mTaskInfo.getParentTaskId() != INVALID_TASK_ID; final WindowContainerTransaction wct = getEnterBubbleTransaction( mTaskInfo.token, mBubbleController.getAppBubbleRootTaskToken(), mTaskInfo.token, mBubbleController.getAppBubbleRootTaskToken(), launchBounds, true /* isAppBubble */, reparentToTda); mHomeIntentProvider.addLaunchHomePendingIntent(wct, mTaskInfo.displayId, mTaskInfo.userId); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/util/BubbleUtils.kt +10 −4 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ object BubbleUtils { private fun getBubbleTransaction( token: WindowContainerToken, rootToken: WindowContainerToken?, bounds: Rect, toBubble: Boolean, isAppBubble: Boolean, reparentToTda: Boolean, Loading @@ -47,6 +48,7 @@ object BubbleUtils { if (BubbleAnythingFlagHelper.enableRootTaskForBubble() && isAppBubble) { if (toBubble && rootToken != null) { wct.reparent(token, rootToken, true /* onTop */) wct.setBounds(rootToken, bounds) wct.setAlwaysOnTop(rootToken, true /* alwaysOnTop */) } else { wct.reparent(token, null, true /* onTop */) Loading @@ -65,6 +67,8 @@ object BubbleUtils { WindowConfiguration.WINDOWING_MODE_UNDEFINED, ) wct.setInterceptBackPressedOnTaskRoot(token, toBubble) wct.setTaskForceExcludedFromRecents(token, toBubble /* forceExcluded */) wct.setDisablePip(token, toBubble /* disablePip */) if (!isAppBubble || !BubbleAnythingFlagHelper.enableRootTaskForBubble()) { wct.setAlwaysOnTop(token, toBubble /* alwaysOnTop */) } Loading @@ -74,12 +78,11 @@ object BubbleUtils { // Always reset everything when exit bubble. wct.setLaunchNextToBubble(token, toBubble /* launchNextToBubble */) } } // TODO: b/407669465 - review if those could also be set on the bubble root task. wct.setTaskForceExcludedFromRecents(token, toBubble /* forceExcluded */) wct.setDisablePip(token, toBubble /* disablePip */) if (BubbleAnythingFlagHelper.enableCreateAnyBubble()) { wct.setDisableLaunchAdjacent(token, toBubble /* disableLaunchAdjacent */) } } if (BubbleAnythingFlagHelper.enableCreateAnyBubble()) { if (!toBubble) { // Clear bounds if moving out of Bubble. wct.setBounds(token, Rect()) Loading Loading @@ -108,12 +111,14 @@ object BubbleUtils { fun getEnterBubbleTransaction( token: WindowContainerToken, rootToken: WindowContainerToken?, bounds: Rect, isAppBubble: Boolean, reparentToTda: Boolean = false, ): WindowContainerTransaction { return getBubbleTransaction( token, rootToken, bounds, toBubble = true, isAppBubble, reparentToTda, Loading @@ -133,6 +138,7 @@ object BubbleUtils { return getBubbleTransaction( token, rootToken = null, bounds = Rect(), toBubble = false, // Everything will be reset, so doesn't matter for exit. isAppBubble = true, Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/util/BubbleUtilsTest.kt +5 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.wm.shell.bubbles.util import android.graphics.Rect import android.os.Binder import android.platform.test.annotations.DisableFlags import android.platform.test.annotations.EnableFlags Loading Loading @@ -52,6 +53,7 @@ class BubbleUtilsTest : ShellTestCase() { private val rootTaskToken = mock<WindowContainerToken> { on { asBinder() } doReturn binder } private val bounds = Rect(0, 0, 100, 100) private val captionInsetsOwner = Binder() @EnableFlags(FLAG_ENABLE_CREATE_ANY_BUBBLE) Loading @@ -59,7 +61,7 @@ class BubbleUtilsTest : ShellTestCase() { @Test fun testGetEnterBubbleTransaction(@TestParameter isAppBubble: Boolean) { val wctWithLaunchNextToBubble = getEnterBubbleTransaction(token, null /* rootToken */, isAppBubble) getEnterBubbleTransaction(token, null /* rootToken */, bounds, isAppBubble) verifyEnterBubbleTransaction(wctWithLaunchNextToBubble, token.asBinder(), isAppBubble) } Loading @@ -72,6 +74,7 @@ class BubbleUtilsTest : ShellTestCase() { getEnterBubbleTransaction( token, rootToken = null, bounds, isAppBubble, reparentToTda = true ) Loading @@ -88,7 +91,7 @@ class BubbleUtilsTest : ShellTestCase() { @Test fun testRootBubbleGetEnterBubbleTransaction() { val isAppBubble = true val wct = getEnterBubbleTransaction(token, rootTaskToken, isAppBubble) val wct = getEnterBubbleTransaction(token, rootTaskToken, bounds, isAppBubble) verifyEnterBubbleTransaction( wct, Loading