Merge changes I6e7c349d,If6c74b3b,Ib276e9dc,Ida0f7cc0 into main
* changes: Override DisplayController on main thread. Add annotations for manipulating secure settings. Don't use UiThreadTest for Taskbar Unit tests. Suspend Launcher taskbar while removed for tests.
This commit is contained in:
committed by
Android (Google) Code Review
commit
f7ca8d60be
@@ -43,6 +43,8 @@ import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_N
|
||||
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_VOICE_INTERACTION_WINDOW_SHOWING;
|
||||
import static com.android.wm.shell.Flags.enableTinyTaskbar;
|
||||
|
||||
import static java.lang.invoke.MethodHandles.Lookup.PROTECTED;
|
||||
|
||||
import android.animation.AnimatorSet;
|
||||
import android.animation.ValueAnimator;
|
||||
import android.app.ActivityOptions;
|
||||
@@ -1515,7 +1517,8 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
|
||||
return mIsNavBarKidsMode && isThreeButtonNav();
|
||||
}
|
||||
|
||||
protected boolean isNavBarForceVisible() {
|
||||
@VisibleForTesting(otherwise = PROTECTED)
|
||||
public boolean isNavBarForceVisible() {
|
||||
return mIsNavBarForceVisible;
|
||||
}
|
||||
|
||||
|
||||
@@ -115,6 +115,7 @@ public class TaskbarManager {
|
||||
private WindowManager mWindowManager;
|
||||
private FrameLayout mTaskbarRootLayout;
|
||||
private boolean mAddedWindow;
|
||||
private boolean mIsSuspended;
|
||||
private final TaskbarNavButtonController mNavButtonController;
|
||||
private final ComponentCallbacks mComponentCallbacks;
|
||||
|
||||
@@ -443,6 +444,8 @@ public class TaskbarManager {
|
||||
*/
|
||||
@VisibleForTesting
|
||||
public synchronized void recreateTaskbar() {
|
||||
if (mIsSuspended) return;
|
||||
|
||||
Trace.beginSection("recreateTaskbar");
|
||||
try {
|
||||
DeviceProfile dp = mUserUnlocked ?
|
||||
@@ -648,8 +651,22 @@ public class TaskbarManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes Taskbar from the window manager and prevents recreation if {@code true}.
|
||||
* <p>
|
||||
* Suspending is for testing purposes only; avoid calling this method in production.
|
||||
*/
|
||||
@VisibleForTesting
|
||||
public void addTaskbarRootViewToWindow() {
|
||||
public void setSuspended(boolean isSuspended) {
|
||||
mIsSuspended = isSuspended;
|
||||
if (mIsSuspended) {
|
||||
removeTaskbarRootViewFromWindow();
|
||||
} else {
|
||||
addTaskbarRootViewToWindow();
|
||||
}
|
||||
}
|
||||
|
||||
private void addTaskbarRootViewToWindow() {
|
||||
if (enableTaskbarNoRecreate() && !mAddedWindow && mTaskbarActivityContext != null) {
|
||||
mWindowManager.addView(mTaskbarRootLayout,
|
||||
mTaskbarActivityContext.getWindowLayoutParams());
|
||||
@@ -657,8 +674,7 @@ public class TaskbarManager {
|
||||
}
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
public void removeTaskbarRootViewFromWindow() {
|
||||
private void removeTaskbarRootViewFromWindow() {
|
||||
if (enableTaskbarNoRecreate() && mAddedWindow) {
|
||||
mWindowManager.removeViewImmediate(mTaskbarRootLayout);
|
||||
mAddedWindow = false;
|
||||
|
||||
Reference in New Issue
Block a user