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

Commit 0488e475 authored by wilsonshih's avatar wilsonshih
Browse files

Clean up null check for mBackNavigationController

Only need to check when calling startBackNavigation.

Bug: 131727607
Test: build/flash
Change-Id: Ib6b92a4019070bc711e7a1ea9462eaf2d404df42
parent df86b40c
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
@@ -460,7 +460,6 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
    KeyguardController mKeyguardController;
    private final ClientLifecycleManager mLifecycleManager;

    @Nullable
    final BackNavigationController mBackNavigationController;

    private TaskChangeNotificationController mTaskChangeNotificationController;
@@ -847,8 +846,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
        mTaskOrganizerController = mWindowOrganizerController.mTaskOrganizerController;
        mTaskFragmentOrganizerController =
                mWindowOrganizerController.mTaskFragmentOrganizerController;
        mBackNavigationController = BackNavigationController.isEnabled()
                ? new BackNavigationController() : null;
        mBackNavigationController = new BackNavigationController();
    }

    public void onSystemReady() {
@@ -1031,11 +1029,9 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
            mLockTaskController.setWindowManager(wm);
            mTaskSupervisor.setWindowManager(wm);
            mRootWindowContainer.setWindowManager(wm);
            if (mBackNavigationController != null) {
            mBackNavigationController.setWindowManager(wm);
        }
    }
    }

    public void setUsageStatsManager(UsageStatsManagerInternal usageStatsManager) {
        synchronized (mGlobalLock) {
@@ -1852,9 +1848,6 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
            IWindowFocusObserver observer, BackAnimationAdapter adapter) {
        mAmInternal.enforceCallingPermission(START_TASKS_FROM_RECENTS,
                "startBackNavigation()");
        if (mBackNavigationController == null) {
            return null;
        }

        return mBackNavigationController.startBackNavigation(observer, adapter);
    }
+7 −4
Original line number Diff line number Diff line
@@ -65,12 +65,12 @@ class BackNavigationController {
    // TODO (b/241808055) Find a appropriate time to remove during refactor
    // Execute back animation with legacy transition system. Temporary flag for easier debugging.
    static final boolean ENABLE_SHELL_TRANSITIONS = WindowManagerService.sEnableShellTransitions;

    /**
     * Returns true if the back predictability feature is enabled
     * true if the back predictability feature is enabled
     */
    static boolean isEnabled() {
        return SystemProperties.getInt("persist.wm.debug.predictive_back", 1) != 0;
    }
    static final boolean sPredictBackEnable =
            SystemProperties.getBoolean("persist.wm.debug.predictive_back", true);

    static boolean isScreenshotEnabled() {
        return SystemProperties.getInt("persist.wm.debug.predictive_back_screenshot", 0) != 0;
@@ -88,6 +88,9 @@ class BackNavigationController {
    @Nullable
    BackNavigationInfo startBackNavigation(
            IWindowFocusObserver observer, BackAnimationAdapter adapter) {
        if (!sPredictBackEnable) {
            return null;
        }
        final WindowManagerService wmService = mWindowManagerService;
        mFocusObserver = observer;

+2 −5
Original line number Diff line number Diff line
@@ -840,11 +840,8 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
        if (recentsAnimationController != null) {
            recentsAnimationController.checkAnimationReady(defaultDisplay.mWallpaperController);
        }
        final BackNavigationController backNavigationController =
                mWmService.mAtmService.mBackNavigationController;
        if (backNavigationController != null) {
            backNavigationController.checkAnimationReady(defaultDisplay.mWallpaperController);
        }
        mWmService.mAtmService.mBackNavigationController
                .checkAnimationReady(defaultDisplay.mWallpaperController);

        for (int displayNdx = 0; displayNdx < mChildren.size(); ++displayNdx) {
            final DisplayContent displayContent = mChildren.get(displayNdx);
+2 −5
Original line number Diff line number Diff line
@@ -239,8 +239,7 @@ class WallpaperController {

    private boolean isBackNavigationTarget(WindowState w) {
        // The window is in animating by back navigation and set to show wallpaper.
        final BackNavigationController controller = mService.mAtmService.mBackNavigationController;
        return controller != null && controller.isWallpaperVisible(w);
        return mService.mAtmService.mBackNavigationController.isWallpaperVisible(w);
    }

    /**
@@ -831,9 +830,7 @@ class WallpaperController {

            // If there was a pending back navigation animation that would show wallpaper, start
            // the animation due to it was skipped in previous surface placement.
            if (mService.mAtmService.mBackNavigationController != null) {
            mService.mAtmService.mBackNavigationController.startAnimation();
            }
            return true;
        }
        return false;