Revert "Hide task bar when folding before the new config renders the correct task bar"

This reverts commit dfb334f1e1.

Reason for revert: A bunch of WM fixes are in (b/291562764)

Change-Id: I9d08dab976cda112f802ee91256c09ef2026a01f
This commit is contained in:
Tracy Zhou
2024-03-23 19:35:50 +00:00
committed by Android (Google) Code Review
parent dfb334f1e1
commit 4dbac6caa9
3 changed files with 1 additions and 58 deletions
@@ -30,7 +30,6 @@ import static com.android.launcher3.util.DisplayController.CHANGE_DENSITY;
import static com.android.launcher3.util.DisplayController.CHANGE_NAVIGATION_MODE;
import static com.android.launcher3.util.DisplayController.CHANGE_TASKBAR_PINNING;
import static com.android.launcher3.util.DisplayController.TASKBAR_NOT_DESTROYED_TAG;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.launcher3.util.FlagDebugUtils.formatFlagChange;
import static com.android.quickstep.util.SystemActionConstants.ACTION_SHOW_TASKBAR;
@@ -44,7 +43,6 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.hardware.devicestate.DeviceStateManager;
import android.hardware.display.DisplayManager;
import android.net.Uri;
import android.os.Handler;
@@ -111,7 +109,6 @@ public class TaskbarManager {
private final Context mContext;
private final @Nullable Context mNavigationBarPanelContext;
private final DeviceStateManager mDeviceStateManager;
private WindowManager mWindowManager;
private FrameLayout mTaskbarRootLayout;
private boolean mAddedWindow;
@@ -178,8 +175,7 @@ public class TaskbarManager {
}
};
private final UnfoldTransitionProgressProvider.TransitionProgressListener
mUnfoldTransitionProgressListener =
UnfoldTransitionProgressProvider.TransitionProgressListener mUnfoldTransitionProgressListener =
new UnfoldTransitionProgressProvider.TransitionProgressListener() {
@Override
public void onTransitionStarted() {
@@ -208,9 +204,6 @@ public class TaskbarManager {
}
};
private final DeviceStateManager.FoldStateListener mFoldStateListener;
private Boolean mFolded;
@SuppressLint("WrongConstant")
public TaskbarManager(TouchInteractionService service) {
Display display =
@@ -236,29 +229,6 @@ public class TaskbarManager {
}
};
}
// Temporary solution to mitigate the visual jump from folding the device. Currently, the
// screen turns on much earlier than we receive the onConfigurationChanged callback or
// receiving the correct device profile. While the ideal the solution is to align turning
// the screen on after onConfigurationChanged (by either delaying turning on the screen or
// figuring out what is causing the delay in getting onConfigurationChanged callback), one
// easy temporary mitigation is to dimming the bar so that the visual jump isn't as glaring.
mFoldStateListener = new DeviceStateManager.FoldStateListener(mContext, folded -> {
boolean firstTime = mFolded == null;
if (mTaskbarActivityContext == null) {
return;
}
if (!firstTime && mFolded.booleanValue() != folded) {
mTaskbarActivityContext.cancelHideTaskbarWhenFolding();
}
mFolded = folded;
if (folded && !firstTime) {
mTaskbarActivityContext.hideTaskbarWhenFolding();
} else {
mTaskbarActivityContext.resetHideTaskbarWhenUnfolding();
}
});
mDeviceStateManager = mContext.getSystemService(DeviceStateManager.class);
mDeviceStateManager.registerCallback(MAIN_EXECUTOR, mFoldStateListener);
mNavButtonController = new TaskbarNavButtonController(service,
SystemUiProxy.INSTANCE.get(mContext), new Handler(),
AssistUtils.newInstance(mContext));
@@ -618,7 +588,6 @@ public class TaskbarManager {
Log.d(TASKBAR_NOT_DESTROYED_TAG, "unregistering component callbacks from destroy().");
mContext.unregisterComponentCallbacks(mComponentCallbacks);
mContext.unregisterReceiver(mShutdownReceiver);
mDeviceStateManager.unregisterCallback(mFoldStateListener);
}
public @Nullable TaskbarActivityContext getCurrentActivityContext() {