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

Commit 3ad18b45 authored by Brian Isganitis's avatar Brian Isganitis Committed by Android (Google) Code Review
Browse files

Merge "Revert "Completely destroy Launcher's Taskbar."" into main

parents 81a63708 e1a2b67f
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -648,7 +648,8 @@ public class TaskbarManager {
        }
    }

    private void addTaskbarRootViewToWindow() {
    @VisibleForTesting
    public void addTaskbarRootViewToWindow() {
        if (enableTaskbarNoRecreate() && !mAddedWindow && mTaskbarActivityContext != null) {
            mWindowManager.addView(mTaskbarRootLayout,
                    mTaskbarActivityContext.getWindowLayoutParams());
@@ -656,7 +657,8 @@ public class TaskbarManager {
        }
    }

    private void removeTaskbarRootViewFromWindow() {
    @VisibleForTesting
    public void removeTaskbarRootViewFromWindow() {
        if (enableTaskbarNoRecreate() && mAddedWindow) {
            mWindowManager.removeViewImmediate(mTaskbarRootLayout);
            mAddedWindow = false;
+6 −2
Original line number Diff line number Diff line
@@ -119,14 +119,18 @@ class TaskbarUnitTestRule(
                try {
                    // Replace Launcher Taskbar window with test instance.
                    instrumentation.runOnMainSync {
                        launcherTaskbarManager?.destroy()
                        launcherTaskbarManager?.removeTaskbarRootViewFromWindow()
                        taskbarManager.onUserUnlocked() // Required to complete initialization.
                    }

                    injectControllers()
                    base.evaluate()
                } finally {
                    instrumentation.runOnMainSync { taskbarManager.destroy() }
                    // Revert Taskbar window.
                    instrumentation.runOnMainSync {
                        taskbarManager.destroy()
                        launcherTaskbarManager?.addTaskbarRootViewToWindow()
                    }
                }
            }
        }