Call setOverviewDragState() whenever taskbar is recreated
* Un/Pinning taskbar re-creates controllers which led to stale state for checking if we are allowing split selection Test: Crash/immediately going into split no longer repros after un/pinning taskbar in overview and trying to split Fixes: 326356246 Change-Id: I06cfc4d1c3c7fe071f04414c3134eaff7960ade6
This commit is contained in:
1 parent
7d5531757b
commit
0adca26744
1 file changed
+18
-8
@@ -205,13 +205,7 @@ public class TaskbarLauncherStateController {
|
||||
mLauncherState = finalState;
|
||||
updateStateForFlag(FLAG_LAUNCHER_IN_STATE_TRANSITION, false);
|
||||
applyState();
|
||||
boolean disallowLongClick =
|
||||
FeatureFlags.enableSplitContextually()
|
||||
? mLauncher.isSplitSelectionActive()
|
||||
: finalState == LauncherState.OVERVIEW_SPLIT_SELECT;
|
||||
com.android.launcher3.taskbar.Utilities.setOverviewDragState(
|
||||
mControllers, finalState.disallowTaskbarGlobalDrag(),
|
||||
disallowLongClick, finalState.allowTaskbarInitialSplitSelection());
|
||||
updateOverviewDragState(finalState);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -256,6 +250,7 @@ public class TaskbarLauncherStateController {
|
||||
|
||||
mCanSyncViews = true;
|
||||
mLauncher.addOnDeviceProfileChangeListener(mOnDeviceProfileChangeListener);
|
||||
updateOverviewDragState(mLauncherState);
|
||||
}
|
||||
|
||||
public void onDestroy() {
|
||||
@@ -328,7 +323,7 @@ public class TaskbarLauncherStateController {
|
||||
updateStateForSysuiFlags(systemUiStateFlags, /* applyState */ true);
|
||||
}
|
||||
|
||||
private void updateStateForSysuiFlags(int systemUiStateFlags, boolean applyState) {
|
||||
private void updateStateForSysuiFlags(int systemUiStateFlags, boolean applyState) {
|
||||
final boolean prevIsAwake = hasAnyFlag(FLAG_AWAKE);
|
||||
final boolean currIsAwake = hasAnyFlag(systemUiStateFlags, SYSUI_STATE_AWAKE);
|
||||
|
||||
@@ -357,6 +352,21 @@ public class TaskbarLauncherStateController {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates overview drag state on various controllers based on {@link #mLauncherState}.
|
||||
*
|
||||
* @param launcherState The current state launcher is in
|
||||
*/
|
||||
private void updateOverviewDragState(LauncherState launcherState) {
|
||||
boolean disallowLongClick =
|
||||
FeatureFlags.enableSplitContextually()
|
||||
? mLauncher.isSplitSelectionActive()
|
||||
: launcherState == LauncherState.OVERVIEW_SPLIT_SELECT;
|
||||
com.android.launcher3.taskbar.Utilities.setOverviewDragState(
|
||||
mControllers, launcherState.disallowTaskbarGlobalDrag(),
|
||||
disallowLongClick, launcherState.allowTaskbarInitialSplitSelection());
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the proper flag to change the state of the task bar.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user