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

Commit 760542f5 authored by Ats Jenk's avatar Ats Jenk
Browse files

Start launcher behind bubbled task

When converting a task to bubble via app handle menu or drag, start
launcher so it shows up behind the bubbled task.
This is needed in cases where two apps are launched back to back. For
example start Messages and then Calculator from taskbar.
When Calculator is converted to bubble using the app handle menu, it
would start on top of Messages. We need to make sure it starts on top of
Launcher home screen.

Bug: 394651724
Test: atest WMShellUnitTests
Flag: com.android.wm.shell.enable_bubble_to_fullscreen
Change-Id: Idbe1ca9123568613b5e3de579c342d3b67918bda
parent 1f4b81ad
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -40,6 +40,7 @@ import com.android.wm.shell.common.DisplayController
import com.android.wm.shell.common.DisplayImeController
import com.android.wm.shell.common.DisplayImeController
import com.android.wm.shell.common.DisplayInsetsController
import com.android.wm.shell.common.DisplayInsetsController
import com.android.wm.shell.common.FloatingContentCoordinator
import com.android.wm.shell.common.FloatingContentCoordinator
import com.android.wm.shell.common.HomeIntentProvider
import com.android.wm.shell.common.SyncTransactionQueue
import com.android.wm.shell.common.SyncTransactionQueue
import com.android.wm.shell.common.TaskStackListenerImpl
import com.android.wm.shell.common.TaskStackListenerImpl
import com.android.wm.shell.common.TestShellExecutor
import com.android.wm.shell.common.TestShellExecutor
@@ -287,7 +288,8 @@ class BubbleControllerBubbleBarTest {
            mock<Transitions>(),
            mock<Transitions>(),
            SyncTransactionQueue(TransactionPool(), mainExecutor),
            SyncTransactionQueue(TransactionPool(), mainExecutor),
            mock<IWindowManager>(),
            mock<IWindowManager>(),
            BubbleResizabilityChecker()
            BubbleResizabilityChecker(),
            HomeIntentProvider(context),
        )
        )
    }
    }


+2 −0
Original line number Original line Diff line number Diff line
@@ -48,6 +48,7 @@ import com.android.wm.shell.common.DisplayImeController
import com.android.wm.shell.common.DisplayInsetsController
import com.android.wm.shell.common.DisplayInsetsController
import com.android.wm.shell.common.DisplayLayout
import com.android.wm.shell.common.DisplayLayout
import com.android.wm.shell.common.FloatingContentCoordinator
import com.android.wm.shell.common.FloatingContentCoordinator
import com.android.wm.shell.common.HomeIntentProvider
import com.android.wm.shell.common.ImeListener
import com.android.wm.shell.common.ImeListener
import com.android.wm.shell.common.SyncTransactionQueue
import com.android.wm.shell.common.SyncTransactionQueue
import com.android.wm.shell.common.TaskStackListenerImpl
import com.android.wm.shell.common.TaskStackListenerImpl
@@ -384,6 +385,7 @@ class BubbleControllerTest {
                SyncTransactionQueue(TransactionPool(), mainExecutor),
                SyncTransactionQueue(TransactionPool(), mainExecutor),
                mock<IWindowManager>(),
                mock<IWindowManager>(),
                resizeChecker,
                resizeChecker,
                HomeIntentProvider(context),
            )
            )
        bubbleController.setInflateSynchronously(true)
        bubbleController.setInflateSynchronously(true)
        bubbleController.onInit()
        bubbleController.onInit()
+3 −1
Original line number Original line Diff line number Diff line
@@ -40,6 +40,7 @@ import com.android.wm.shell.common.DisplayController
import com.android.wm.shell.common.DisplayImeController
import com.android.wm.shell.common.DisplayImeController
import com.android.wm.shell.common.DisplayInsetsController
import com.android.wm.shell.common.DisplayInsetsController
import com.android.wm.shell.common.FloatingContentCoordinator
import com.android.wm.shell.common.FloatingContentCoordinator
import com.android.wm.shell.common.HomeIntentProvider
import com.android.wm.shell.common.SyncTransactionQueue
import com.android.wm.shell.common.SyncTransactionQueue
import com.android.wm.shell.common.TaskStackListenerImpl
import com.android.wm.shell.common.TaskStackListenerImpl
import com.android.wm.shell.common.TestShellExecutor
import com.android.wm.shell.common.TestShellExecutor
@@ -160,7 +161,8 @@ class BubbleViewInfoTaskTest {
                mock<Transitions>(),
                mock<Transitions>(),
                SyncTransactionQueue(TransactionPool(), mainExecutor),
                SyncTransactionQueue(TransactionPool(), mainExecutor),
                mock<IWindowManager>(),
                mock<IWindowManager>(),
                BubbleResizabilityChecker()
                BubbleResizabilityChecker(),
                HomeIntentProvider(context),
            )
            )


        // TODO: (b/371829099) - when optional overflow is no longer flagged we can enable this
        // TODO: (b/371829099) - when optional overflow is no longer flagged we can enable this
+3 −1
Original line number Original line Diff line number Diff line
@@ -61,6 +61,7 @@ import com.android.wm.shell.common.DisplayController
import com.android.wm.shell.common.DisplayImeController
import com.android.wm.shell.common.DisplayImeController
import com.android.wm.shell.common.DisplayInsetsController
import com.android.wm.shell.common.DisplayInsetsController
import com.android.wm.shell.common.FloatingContentCoordinator
import com.android.wm.shell.common.FloatingContentCoordinator
import com.android.wm.shell.common.HomeIntentProvider
import com.android.wm.shell.common.SyncTransactionQueue
import com.android.wm.shell.common.SyncTransactionQueue
import com.android.wm.shell.common.TaskStackListenerImpl
import com.android.wm.shell.common.TaskStackListenerImpl
import com.android.wm.shell.common.TestShellExecutor
import com.android.wm.shell.common.TestShellExecutor
@@ -231,7 +232,8 @@ class BubbleBarLayerViewTest {
            mock<Transitions>(),
            mock<Transitions>(),
            SyncTransactionQueue(TransactionPool(), mainExecutor),
            SyncTransactionQueue(TransactionPool(), mainExecutor),
            mock<IWindowManager>(),
            mock<IWindowManager>(),
            BubbleResizabilityChecker()
            BubbleResizabilityChecker(),
            HomeIntentProvider(context),
        )
        )
    }
    }


+6 −2
Original line number Original line Diff line number Diff line
@@ -104,6 +104,7 @@ import com.android.wm.shell.common.DisplayImeController;
import com.android.wm.shell.common.DisplayInsetsController;
import com.android.wm.shell.common.DisplayInsetsController;
import com.android.wm.shell.common.ExternalInterfaceBinder;
import com.android.wm.shell.common.ExternalInterfaceBinder;
import com.android.wm.shell.common.FloatingContentCoordinator;
import com.android.wm.shell.common.FloatingContentCoordinator;
import com.android.wm.shell.common.HomeIntentProvider;
import com.android.wm.shell.common.ImeListener;
import com.android.wm.shell.common.ImeListener;
import com.android.wm.shell.common.RemoteCallable;
import com.android.wm.shell.common.RemoteCallable;
import com.android.wm.shell.common.ShellExecutor;
import com.android.wm.shell.common.ShellExecutor;
@@ -216,6 +217,7 @@ public class BubbleController implements ConfigurationChangeListener,
    private final BubbleTaskViewFactory mBubbleTaskViewFactory;
    private final BubbleTaskViewFactory mBubbleTaskViewFactory;
    private final BubbleExpandedViewManager mExpandedViewManager;
    private final BubbleExpandedViewManager mExpandedViewManager;
    private final ResizabilityChecker mResizabilityChecker;
    private final ResizabilityChecker mResizabilityChecker;
    private final HomeIntentProvider mHomeIntentProvider;


    // Used to post to main UI thread
    // Used to post to main UI thread
    private final ShellExecutor mMainExecutor;
    private final ShellExecutor mMainExecutor;
@@ -331,7 +333,8 @@ public class BubbleController implements ConfigurationChangeListener,
            Transitions transitions,
            Transitions transitions,
            SyncTransactionQueue syncQueue,
            SyncTransactionQueue syncQueue,
            IWindowManager wmService,
            IWindowManager wmService,
            ResizabilityChecker resizabilityChecker) {
            ResizabilityChecker resizabilityChecker,
            HomeIntentProvider homeIntentProvider) {
        mContext = context;
        mContext = context;
        mShellCommandHandler = shellCommandHandler;
        mShellCommandHandler = shellCommandHandler;
        mShellController = shellController;
        mShellController = shellController;
@@ -393,6 +396,7 @@ public class BubbleController implements ConfigurationChangeListener,
        };
        };
        mExpandedViewManager = BubbleExpandedViewManager.fromBubbleController(this);
        mExpandedViewManager = BubbleExpandedViewManager.fromBubbleController(this);
        mResizabilityChecker = resizabilityChecker;
        mResizabilityChecker = resizabilityChecker;
        mHomeIntentProvider = homeIntentProvider;
    }
    }


    private void registerOneHandedState(OneHandedController oneHanded) {
    private void registerOneHandedState(OneHandedController oneHanded) {
@@ -1622,7 +1626,7 @@ public class BubbleController implements ConfigurationChangeListener,
            ensureBubbleViewsAndWindowCreated();
            ensureBubbleViewsAndWindowCreated();
            mBubbleTransitions.startConvertToBubble(b, taskInfo, mExpandedViewManager,
            mBubbleTransitions.startConvertToBubble(b, taskInfo, mExpandedViewManager,
                    mBubbleTaskViewFactory, mBubblePositioner, mStackView, mLayerView,
                    mBubbleTaskViewFactory, mBubblePositioner, mStackView, mLayerView,
                    mBubbleIconFactory, dragData, mInflateSynchronously);
                    mBubbleIconFactory, mHomeIntentProvider, dragData, mInflateSynchronously);
        }
        }
    }
    }


Loading