Taskbar fixes when apps move to desktop and back
Fixes to taskbar state when tasks are moved to desktop and fullscreen. When freeform tasks are visible and we start a new task from taskbar, it first launches in fullscreen. Transition handler in WMSHell switches it to freeform as needed. This switch causes launcher activity to be paused and then resumed. Resuming launcher activity while freeform tasks are visible, puts the launcher into an incorrect state. (Launcher should appear paused while freeform tasks are visible). When a freeform task switches to fullscreen, freeform tasks are no longer visible. This causes us to resume the launcher activity. We should not do that if a fullscreen task is visible as it puts the launcher into an incorrect state. It appears resumed even though the activity is paused. Added a check to DesktopVisibilityController that checks if the activity is actually resumed before marking it appear as resumed. Test: manual, switch a task to freeform, launch another freeform task from taskbar, taskbar should continue to be available Test: manual, switch a task to freeform, switch the task back to fullscreen, taskbar should continue to be available Bug: 261234278 Change-Id: Ia8d208619fabfcc9bffff6d8d227b236cb62a00c
This commit is contained in:
1 parent
0c2d7e8da3
commit
0ea4768a02
3 files changed
+30
-5
No files matched your search
@@ -43,7 +43,7 @@ public class DesktopVisibilityController {
|
||||
*/
|
||||
private boolean isDesktopModeSupported() {
|
||||
return SystemProperties.getBoolean("persist.wm.debug.desktop_mode", false)
|
||||
|| SystemProperties.getBoolean("persist.wm.debug.desktop_mode_2", false);
|
||||
|| SystemProperties.getBoolean("persist.wm.debug.desktop_mode_2", false);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -81,7 +81,9 @@ public class DesktopVisibilityController {
|
||||
StatefulActivity<LauncherState> activity =
|
||||
QuickstepLauncher.ACTIVITY_TRACKER.getCreatedActivity();
|
||||
View workspaceView = mLauncher.getWorkspace();
|
||||
if (activity == null || workspaceView == null || !isDesktopModeSupported()) return;
|
||||
if (activity == null || workspaceView == null || !isDesktopModeSupported()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mFreeformTasksVisible) {
|
||||
workspaceView.setVisibility(View.INVISIBLE);
|
||||
@@ -93,7 +95,12 @@ public class DesktopVisibilityController {
|
||||
} else {
|
||||
workspaceView.setVisibility(View.VISIBLE);
|
||||
// If freeform isn't visible ensure that launcher appears resumed to behave normally.
|
||||
activity.setResumed();
|
||||
// Check activity state before calling setResumed(). Launcher may have been actually
|
||||
// paused (eg fullscreen task moved to front).
|
||||
// In this case we should not mark the activity as resumed.
|
||||
if (activity.isResumed()) {
|
||||
activity.setResumed();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user