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

Commit cab4346b authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Add some checks before using deferred-set controllers"

parents 46b29daa 88d33ffa
Loading
Loading
Loading
Loading
+22 −10
Original line number Diff line number Diff line
@@ -860,10 +860,13 @@ public class NavigationBar implements View.OnAttachStateChangeListener,
        final int barMode = barMode(mTransientShown, mAppearance);
        mNavigationBarMode = barMode;
        checkNavBarModes();
        if (mAutoHideController != null) {
            mAutoHideController.touchAutoHide();

        mLightBarController.onNavigationBarAppearanceChanged(mAppearance, true /* nbModeChanged */,
                barMode, false /* navbarColorManagedByIme */);
        }
        if (mLightBarController != null) {
            mLightBarController.onNavigationBarAppearanceChanged(mAppearance,
                    true /* nbModeChanged */, barMode, false /* navbarColorManagedByIme */);
        }
    }

    @Override
@@ -880,9 +883,11 @@ public class NavigationBar implements View.OnAttachStateChangeListener,
            }
            nbModeChanged = updateBarMode(barMode(mTransientShown, appearance));
        }
        if (mLightBarController != null) {
            mLightBarController.onNavigationBarAppearanceChanged(appearance, nbModeChanged,
                    mNavigationBarMode, navbarColorManagedByIme);
        }
    }

    @Override
    public void showTransient(int displayId, @InternalInsetsType int[] types) {
@@ -924,7 +929,7 @@ public class NavigationBar implements View.OnAttachStateChangeListener,
            mNavigationBarView.onTransientStateChanged(mTransientShown);
        }
        final int barMode = barMode(mTransientShown, mAppearance);
        if (updateBarMode(barMode)) {
        if (updateBarMode(barMode) && mLightBarController != null) {
            mLightBarController.onNavigationBarModeChanged(barMode);
        }
    }
@@ -938,7 +943,9 @@ public class NavigationBar implements View.OnAttachStateChangeListener,
            }
            mNavigationBarMode = barMode;
            checkNavBarModes();
            if (mAutoHideController != null) {
                mAutoHideController.touchAutoHide();
            }
            return true;
        }
        return false;
@@ -1097,7 +1104,9 @@ public class NavigationBar implements View.OnAttachStateChangeListener,
    }

    private boolean onNavigationTouch(View v, MotionEvent event) {
        if (mAutoHideController != null) {
            mAutoHideController.checkUserAutoHide(event);
        }
        return false;
    }

@@ -1356,7 +1365,10 @@ public class NavigationBar implements View.OnAttachStateChangeListener,

    public void setLightBarController(LightBarController lightBarController) {
        mLightBarController = lightBarController;
        mLightBarController.setNavigationBar(mNavigationBarView.getLightTransitionsController());
        if (mLightBarController != null) {
            mLightBarController.setNavigationBar(
                    mNavigationBarView.getLightTransitionsController());
        }
    }

    /** Sets {@link AutoHideController} to the navigation bar. */