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

Commit c7d35f5a authored by Winson Chung's avatar Winson Chung Committed by Automerger Merge Worker
Browse files

Merge changes from topic "nav_bar_helper_1" into tm-qpr-dev am: 2b2deec8

parents 94717c62 2b2deec8
Loading
Loading
Loading
Loading
+54 −37
Original line number Diff line number Diff line
@@ -96,9 +96,9 @@ public class RotationButtonController {
    private boolean mHoveringRotationSuggestion;
    private final AccessibilityManager mAccessibilityManager;
    private final TaskStackListenerImpl mTaskStackListener;
    private Consumer<Integer> mRotWatcherListener;

    private boolean mListenersRegistered = false;
    private boolean mRotationWatcherRegistered = false;
    private boolean mIsNavigationBarShowing;
    @SuppressLint("InlinedApi")
    private @WindowInsetsController.Behavior
@@ -140,22 +140,7 @@ public class RotationButtonController {
            // We need this to be scheduled as early as possible to beat the redrawing of
            // window in response to the orientation change.
            mMainThreadHandler.postAtFrontOfQueue(() -> {
                // If the screen rotation changes while locked, potentially update lock to flow with
                // new screen rotation and hide any showing suggestions.
                boolean rotationLocked = isRotationLocked();
                // The isVisible check makes the rotation button disappear when we are not locked
                // (e.g. for tabletop auto-rotate).
                if (rotationLocked || mRotationButton.isVisible()) {
                    // Do not allow a change in rotation to set user rotation when docked.
                    if (shouldOverrideUserLockPrefs(rotation) && rotationLocked && !mDocked) {
                        setRotationLockedAtAngle(rotation);
                    }
                    setRotateSuggestionButtonState(false /* visible */, true /* forced */);
                }

                if (mRotWatcherListener != null) {
                    mRotWatcherListener.accept(rotation);
                }
                onRotationWatcherChanged(rotation);
            });
        }
    };
@@ -206,8 +191,11 @@ public class RotationButtonController {
        return mContext;
    }

    /**
     * Called during Taskbar initialization.
     */
    public void init() {
        registerListeners();
        registerListeners(true /* registerRotationWatcher */);
        if (mContext.getDisplay().getDisplayId() != DEFAULT_DISPLAY) {
            // Currently there is no accelerometer sensor on non-default display, disable fixed
            // rotation for non-default display
@@ -215,11 +203,14 @@ public class RotationButtonController {
        }
    }

    /**
     * Called during Taskbar uninitialization.
     */
    public void onDestroy() {
        unregisterListeners();
    }

    public void registerListeners() {
    public void registerListeners(boolean registerRotationWatcher) {
        if (mListenersRegistered || getContext().getPackageManager().hasSystemFeature(FEATURE_PC)) {
            return;
        }
@@ -229,16 +220,19 @@ public class RotationButtonController {
        updateDockedState(mContext.registerReceiver(mDockedReceiver,
                new IntentFilter(Intent.ACTION_DOCK_EVENT)));

        if (registerRotationWatcher) {
            try {
                WindowManagerGlobal.getWindowManagerService()
                        .watchRotation(mRotationWatcher, DEFAULT_DISPLAY);
                mRotationWatcherRegistered = true;
            } catch (IllegalArgumentException e) {
                mListenersRegistered = false;
            Log.w(TAG, "RegisterListeners for the display failed");
                Log.w(TAG, "RegisterListeners for the display failed", e);
            } catch (RemoteException e) {
                Log.e(TAG, "RegisterListeners caught a RemoteException", e);
                return;
            }
        }

        TaskStackChangeListeners.getInstance().registerTaskStackListener(mTaskStackListener);
    }
@@ -251,18 +245,17 @@ public class RotationButtonController {
        mListenersRegistered = false;

        mContext.unregisterReceiver(mDockedReceiver);
        if (mRotationWatcherRegistered) {
            try {
            WindowManagerGlobal.getWindowManagerService().removeRotationWatcher(mRotationWatcher);
                WindowManagerGlobal.getWindowManagerService().removeRotationWatcher(
                        mRotationWatcher);
            } catch (RemoteException e) {
                Log.e(TAG, "UnregisterListeners caught a RemoteException", e);
                return;
            }

        TaskStackChangeListeners.getInstance().unregisterTaskStackListener(mTaskStackListener);
        }

    public void setRotationCallback(Consumer<Integer> watcher) {
        mRotWatcherListener = watcher;
        TaskStackChangeListeners.getInstance().unregisterTaskStackListener(mTaskStackListener);
    }

    public void setRotationLockedAtAngle(int rotationSuggestion) {
@@ -427,6 +420,30 @@ public class RotationButtonController {
        }
    }

    /**
     * Called when the rotation watcher rotation changes, either from the watcher registered
     * internally in this class, or a signal propagated from NavBarHelper.
     */
    public void onRotationWatcherChanged(int rotation) {
        if (!mListenersRegistered) {
            // Ignore if not registered
            return;
        }

        // If the screen rotation changes while locked, potentially update lock to flow with
        // new screen rotation and hide any showing suggestions.
        boolean rotationLocked = isRotationLocked();
        // The isVisible check makes the rotation button disappear when we are not locked
        // (e.g. for tabletop auto-rotate).
        if (rotationLocked || mRotationButton.isVisible()) {
            // Do not allow a change in rotation to set user rotation when docked.
            if (shouldOverrideUserLockPrefs(rotation) && rotationLocked && !mDocked) {
                setRotationLockedAtAngle(rotation);
            }
            setRotateSuggestionButtonState(false /* visible */, true /* forced */);
        }
    }

    public void onDisable2FlagChanged(int state2) {
        final boolean rotateSuggestionsDisabled = hasDisable2RotateSuggestionFlag(state2);
        if (rotateSuggestionsDisabled) onRotationSuggestionsDisabled();
+160 −21
Original line number Diff line number Diff line
@@ -41,11 +41,17 @@ import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.RemoteException;
import android.os.UserHandle;
import android.provider.Settings;
import android.provider.Settings.Secure;
import android.util.Log;
import android.view.IRotationWatcher;
import android.view.IWallpaperVisibilityListener;
import android.view.IWindowManager;
import android.view.View;
import android.view.WindowInsets;
import android.view.WindowManagerGlobal;
import android.view.accessibility.AccessibilityManager;

import androidx.annotation.NonNull;
@@ -57,7 +63,9 @@ import com.android.systemui.accessibility.SystemActions;
import com.android.systemui.assist.AssistManager;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dump.DumpManager;
import com.android.systemui.navigationbar.gestural.EdgeBackGestureHandler;
import com.android.systemui.recents.OverviewProxyService;
import com.android.systemui.settings.DisplayTracker;
import com.android.systemui.settings.UserTracker;
import com.android.systemui.shared.system.QuickStepContract;
import com.android.systemui.statusbar.CommandQueue;
@@ -90,6 +98,9 @@ public final class NavBarHelper implements
        AccessibilityButtonTargetsObserver.TargetsChangedListener,
        OverviewProxyService.OverviewProxyListener, NavigationModeController.ModeChangedListener,
        Dumpable, CommandQueue.Callbacks {
    private static final String TAG = NavBarHelper.class.getSimpleName();

    private final Handler mHandler = new Handler(Looper.getMainLooper());
    private final AccessibilityManager mAccessibilityManager;
    private final Lazy<AssistManager> mAssistManagerLazy;
    private final Lazy<Optional<CentralSurfaces>> mCentralSurfacesOptionalLazy;
@@ -98,28 +109,60 @@ public final class NavBarHelper implements
    private final SystemActions mSystemActions;
    private final AccessibilityButtonModeObserver mAccessibilityButtonModeObserver;
    private final AccessibilityButtonTargetsObserver mAccessibilityButtonTargetsObserver;
    private final List<NavbarTaskbarStateUpdater> mA11yEventListeners = new ArrayList<>();
    private final List<NavbarTaskbarStateUpdater> mStateListeners = new ArrayList<>();
    private final Context mContext;
    private final CommandQueue mCommandQueue;
    private final ContentResolver mContentResolver;
    private final EdgeBackGestureHandler mEdgeBackGestureHandler;
    private final IWindowManager mWm;
    private final int mDefaultDisplayId;
    private boolean mAssistantAvailable;
    private boolean mLongPressHomeEnabled;
    private boolean mAssistantTouchGestureEnabled;
    private int mNavBarMode;
    private int mA11yButtonState;
    private int mRotationWatcherRotation;
    private boolean mTogglingNavbarTaskbar;
    private boolean mWallpaperVisible;

    // Attributes used in NavBarHelper.CurrentSysuiState
    private int mWindowStateDisplayId;
    private @WindowVisibleState int mWindowState;

    private final ContentObserver mAssistContentObserver = new ContentObserver(
            new Handler(Looper.getMainLooper())) {
    // Listens for changes to the assistant
    private final ContentObserver mAssistContentObserver = new ContentObserver(mHandler) {
        @Override
        public void onChange(boolean selfChange, Uri uri) {
            updateAssistantAvailability();
        }
    };

    // Listens for changes to the wallpaper visibility
    private final IWallpaperVisibilityListener mWallpaperVisibilityListener =
            new IWallpaperVisibilityListener.Stub() {
                @Override
                public void onWallpaperVisibilityChanged(boolean visible,
                        int displayId) throws RemoteException {
                    mHandler.post(() -> {
                        mWallpaperVisible = visible;
                        dispatchWallpaperVisibilityChanged(visible, displayId);
                    });
                }
            };

    // Listens for changes to display rotation
    private final IRotationWatcher mRotationWatcher = new IRotationWatcher.Stub() {
        @Override
        public void onRotationChanged(final int rotation) {
            // We need this to be scheduled as early as possible to beat the redrawing of
            // window in response to the orientation change.
            mHandler.postAtFrontOfQueue(() -> {
                mRotationWatcherRotation = rotation;
                dispatchRotationChanged(rotation);
            });
        }
    };

    /**
     * @param context This is not display specific, then again neither is any of the code in
     *                this class. Once there's display specific code, we may want to create an
@@ -135,7 +178,10 @@ public final class NavBarHelper implements
            Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy,
            KeyguardStateController keyguardStateController,
            NavigationModeController navigationModeController,
            EdgeBackGestureHandler.Factory edgeBackGestureHandlerFactory,
            IWindowManager wm,
            UserTracker userTracker,
            DisplayTracker displayTracker,
            DumpManager dumpManager,
            CommandQueue commandQueue) {
        mContext = context;
@@ -147,18 +193,36 @@ public final class NavBarHelper implements
        mKeyguardStateController = keyguardStateController;
        mUserTracker = userTracker;
        mSystemActions = systemActions;
        accessibilityManager.addAccessibilityServicesStateChangeListener(this);
        mAccessibilityButtonModeObserver = accessibilityButtonModeObserver;
        mAccessibilityButtonTargetsObserver = accessibilityButtonTargetsObserver;
        mWm = wm;
        mDefaultDisplayId = displayTracker.getDefaultDisplayId();
        mEdgeBackGestureHandler = edgeBackGestureHandlerFactory.create(context);

        mAccessibilityButtonModeObserver.addListener(this);
        mAccessibilityButtonTargetsObserver.addListener(this);
        mNavBarMode = navigationModeController.addListener(this);
        mCommandQueue.addCallback(this);
        overviewProxyService.addCallback(this);
        dumpManager.registerDumpable(this);
    }

    public void init() {
    /**
     * Hints to the helper that bars are being replaced, which is a signal to potentially suppress
     * normal setup/cleanup when no bars are present.
     */
    public void setTogglingNavbarTaskbar(boolean togglingNavbarTaskbar) {
        mTogglingNavbarTaskbar = togglingNavbarTaskbar;
    }

    /**
     * Called when the first (non-replacing) bar is registered.
     */
    private void setupOnFirstBar() {
        // Setup accessibility listeners
        mAccessibilityManager.addAccessibilityServicesStateChangeListener(this);
        mAccessibilityButtonModeObserver.addListener(this);
        mAccessibilityButtonTargetsObserver.addListener(this);

        // Setup assistant listener
        mContentResolver.registerContentObserver(
                Settings.Secure.getUriFor(Settings.Secure.ASSISTANT),
                false /* notifyForDescendants */, mAssistContentObserver, UserHandle.USER_ALL);
@@ -168,59 +232,114 @@ public final class NavBarHelper implements
        mContentResolver.registerContentObserver(
                Settings.Secure.getUriFor(Settings.Secure.ASSIST_TOUCH_GESTURE_ENABLED),
                false, mAssistContentObserver, UserHandle.USER_ALL);
        updateAssistantAvailability();
        updateA11yState();
        mCommandQueue.addCallback(this);

        // Setup display rotation watcher
        try {
            mWm.watchRotation(mRotationWatcher, mDefaultDisplayId);
        } catch (Exception e) {
            Log.w(TAG, "Failed to register rotation watcher", e);
        }

        // Setup wallpaper visibility listener
        try {
            mWallpaperVisible = mWm.registerWallpaperVisibilityListener(
                    mWallpaperVisibilityListener, mDefaultDisplayId);
        } catch (Exception e) {
            Log.w(TAG, "Failed to register wallpaper visibility listener", e);
        }

    public void destroy() {
        // Attach the back handler only when the first bar is registered
        mEdgeBackGestureHandler.onNavBarAttached();
    }

    /**
     * Called after the last (non-replacing) bar is unregistered.
     */
    private void cleanupAfterLastBar() {
        // Clean up accessibility listeners
        mAccessibilityManager.removeAccessibilityServicesStateChangeListener(this);
        mAccessibilityButtonModeObserver.removeListener(this);
        mAccessibilityButtonTargetsObserver.removeListener(this);

        // Clean up assistant listeners
        mContentResolver.unregisterContentObserver(mAssistContentObserver);
        mCommandQueue.removeCallback(this);

        // Clean up display rotation watcher
        try {
            mWm.removeRotationWatcher(mRotationWatcher);
        } catch (Exception e) {
            Log.w(TAG, "Failed to unregister rotation watcher", e);
        }

        // Clean up wallpaper visibility listener
        try {
            mWm.unregisterWallpaperVisibilityListener(mWallpaperVisibilityListener,
                    mDefaultDisplayId);
        } catch (Exception e) {
            Log.w(TAG, "Failed to register wallpaper visibility listener", e);
        }

        // No more bars, detach the back handler for now
        mEdgeBackGestureHandler.onNavBarDetached();
    }

    /**
     * Registers a listener for future updates to the shared navbar/taskbar state.
     * @param listener Will immediately get callbacks based on current state
     */
    public void registerNavTaskStateUpdater(NavbarTaskbarStateUpdater listener) {
        mA11yEventListeners.add(listener);
        mStateListeners.add(listener);
        if (!mTogglingNavbarTaskbar && mStateListeners.size() == 1) {
            setupOnFirstBar();

            // Update the state once the first bar is registered
            updateAssistantAvailability();
            updateA11yState();
            mCommandQueue.recomputeDisableFlags(mContext.getDisplayId(), false /* animate */);
        } else {
            listener.updateAccessibilityServicesState();
            listener.updateAssistantAvailable(mAssistantAvailable, mLongPressHomeEnabled);
        }
        listener.updateWallpaperVisibility(mWallpaperVisible, mDefaultDisplayId);
        listener.updateRotationWatcherState(mRotationWatcherRotation);
    }

    /**
     * Removes a previously registered listener.
     */
    public void removeNavTaskStateUpdater(NavbarTaskbarStateUpdater listener) {
        mA11yEventListeners.remove(listener);
        mStateListeners.remove(listener);
        if (!mTogglingNavbarTaskbar && mStateListeners.isEmpty()) {
            cleanupAfterLastBar();
        }
    }

    private void dispatchA11yEventUpdate() {
        for (NavbarTaskbarStateUpdater listener : mA11yEventListeners) {
        for (NavbarTaskbarStateUpdater listener : mStateListeners) {
            listener.updateAccessibilityServicesState();
        }
    }

    private void dispatchAssistantEventUpdate(boolean assistantAvailable,
            boolean longPressHomeEnabled) {
        for (NavbarTaskbarStateUpdater listener : mA11yEventListeners) {
        for (NavbarTaskbarStateUpdater listener : mStateListeners) {
            listener.updateAssistantAvailable(assistantAvailable, longPressHomeEnabled);
        }
    }

    @Override
    public void onAccessibilityServicesStateChanged(AccessibilityManager manager) {
        dispatchA11yEventUpdate();
        updateA11yState();
    }

    @Override
    public void onAccessibilityButtonModeChanged(int mode) {
        updateA11yState();
        dispatchA11yEventUpdate();
    }

    @Override
    public void onAccessibilityButtonTargetsChanged(String targets) {
        updateA11yState();
        dispatchA11yEventUpdate();
    }

    /**
@@ -262,6 +381,8 @@ public final class NavBarHelper implements
            updateSystemAction(clickable, SYSTEM_ACTION_ID_ACCESSIBILITY_BUTTON);
            updateSystemAction(longClickable, SYSTEM_ACTION_ID_ACCESSIBILITY_BUTTON_CHOOSER);
        }

        dispatchA11yEventUpdate();
    }

    /**
@@ -319,6 +440,10 @@ public final class NavBarHelper implements
        return mLongPressHomeEnabled;
    }

    public EdgeBackGestureHandler getEdgeBackGestureHandler() {
        return mEdgeBackGestureHandler;
    }

    @Override
    public void startAssistant(Bundle bundle) {
        mAssistManagerLazy.get().startAssist(bundle);
@@ -357,6 +482,18 @@ public final class NavBarHelper implements
        mWindowState = state;
    }

    private void dispatchWallpaperVisibilityChanged(boolean visible, int displayId) {
        for (NavbarTaskbarStateUpdater listener : mStateListeners) {
            listener.updateWallpaperVisibility(visible, displayId);
        }
    }

    private void dispatchRotationChanged(int rotation) {
        for (NavbarTaskbarStateUpdater listener : mStateListeners) {
            listener.updateRotationWatcherState(rotation);
        }
    }

    public CurrentSysuiState getCurrentSysuiState() {
        return new CurrentSysuiState();
    }
@@ -368,6 +505,8 @@ public final class NavBarHelper implements
    public interface NavbarTaskbarStateUpdater {
        void updateAccessibilityServicesState();
        void updateAssistantAvailable(boolean available, boolean longPressHomeEnabled);
        default void updateWallpaperVisibility(boolean visible, int displayId) {}
        default void updateRotationWatcherState(int rotation) {}
    }

    /** Data class to help Taskbar/Navbar initiate state correctly when switching between the two.*/
+22 −19
Original line number Diff line number Diff line
@@ -164,7 +164,6 @@ import java.util.Locale;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.Executor;
import java.util.function.Consumer;

import javax.inject.Inject;

@@ -209,7 +208,6 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
    private final Optional<Recents> mRecentsOptional;
    private final DeviceConfigProxy mDeviceConfigProxy;
    private final NavigationBarTransitions mNavigationBarTransitions;
    private final EdgeBackGestureHandler mEdgeBackGestureHandler;
    private final Optional<BackAnimation> mBackAnimation;
    private final Handler mHandler;
    private final UiEventLogger mUiEventLogger;
@@ -221,6 +219,7 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
    private final DisplayTracker mDisplayTracker;
    private final RegionSamplingHelper mRegionSamplingHelper;
    private final int mNavColorSampleMargin;
    private EdgeBackGestureHandler mEdgeBackGestureHandler;
    private NavigationBarFrame mFrame;

    private @WindowVisibleState int mNavigationBarWindowState = WINDOW_STATE_SHOWING;
@@ -350,6 +349,21 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
                    mLongPressHomeEnabled = longPressHomeEnabled;
                    updateAssistantEntrypoints(available, longPressHomeEnabled);
                }

                @Override
                public void updateWallpaperVisibility(boolean visible, int displayId) {
                    mNavigationBarTransitions.setWallpaperVisibility(visible);
                }

                @Override
                public void updateRotationWatcherState(int rotation) {
                    if (mIsOnDefaultDisplay && mView != null) {
                        mView.getRotationButtonController().onRotationWatcherChanged(rotation);
                        if (mView.needsReorient(rotation)) {
                            repositionNavigationBar(rotation);
                        }
                    }
                }
            };

    private final OverviewProxyListener mOverviewProxyListener = new OverviewProxyListener() {
@@ -543,7 +557,6 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
            DeadZone deadZone,
            DeviceConfigProxy deviceConfigProxy,
            NavigationBarTransitions navigationBarTransitions,
            EdgeBackGestureHandler edgeBackGestureHandler,
            Optional<BackAnimation> backAnimation,
            UserContextProvider userContextProvider,
            WakefulnessLifecycle wakefulnessLifecycle,
@@ -573,7 +586,6 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
        mDeadZone = deadZone;
        mDeviceConfigProxy = deviceConfigProxy;
        mNavigationBarTransitions = navigationBarTransitions;
        mEdgeBackGestureHandler = edgeBackGestureHandler;
        mBackAnimation = backAnimation;
        mHandler = mainHandler;
        mUiEventLogger = uiEventLogger;
@@ -589,6 +601,7 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
        mWakefulnessLifecycle = wakefulnessLifecycle;
        mTaskStackChangeListeners = taskStackChangeListeners;
        mDisplayTracker = displayTracker;
        mEdgeBackGestureHandler = navBarHelper.getEdgeBackGestureHandler();

        mNavColorSampleMargin = getResources()
                .getDimensionPixelSize(R.dimen.navigation_handle_sample_horizontal_margin);
@@ -677,13 +690,14 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
        // start firing, since the latter is source of truth
        parseCurrentSysuiState();
        mCommandQueue.addCallback(this);
        mLongPressHomeEnabled = mNavBarHelper.getLongPressHomeEnabled();
        mNavBarHelper.init();
        mHomeButtonLongPressDurationMs = Optional.of(mDeviceConfigProxy.getLong(
                DeviceConfig.NAMESPACE_SYSTEMUI,
                HOME_BUTTON_LONG_PRESS_DURATION_MS,
                /* defaultValue = */ 0
        )).filter(duration -> duration != 0);
        // This currently MUST be called after mHomeButtonLongPressDurationMs is initialized since
        // the registration callbacks will trigger code that uses it
        mNavBarHelper.registerNavTaskStateUpdater(mNavbarTaskbarStateUpdater);
        mDeviceConfigProxy.addOnPropertiesChangedListener(
                DeviceConfig.NAMESPACE_SYSTEMUI, mHandler::post, mOnPropertiesChangedListener);

@@ -707,9 +721,9 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
        mCommandQueue.removeCallback(this);
        mWindowManager.removeViewImmediate(mView.getRootView());
        mNavigationModeController.removeListener(mModeChangedListener);
        mEdgeBackGestureHandler.setStateChangeCallback(null);

        mNavBarHelper.removeNavTaskStateUpdater(mNavbarTaskbarStateUpdater);
        mNavBarHelper.destroy();
        mNotificationShadeDepthController.removeListener(mDepthListener);

        mDeviceConfigProxy.removeOnPropertiesChangedListener(mOnPropertiesChangedListener);
@@ -746,8 +760,6 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
        mView.getViewRootImpl().addSurfaceChangedCallback(mSurfaceChangedCallback);
        notifyNavigationBarSurface();

        mNavBarHelper.registerNavTaskStateUpdater(mNavbarTaskbarStateUpdater);

        mPipOptional.ifPresent(mView::addPipExclusionBoundsChangeListener);
        mBackAnimation.ifPresent(mView::registerBackAnimation);

@@ -765,7 +777,6 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
        if (mIsOnDefaultDisplay) {
            final RotationButtonController rotationButtonController =
                    mView.getRotationButtonController();
            rotationButtonController.setRotationCallback(mRotationWatcher);

            // Reset user rotation pref to match that of the WindowManager if starting in locked
            // mode. This will automatically happen when switching from auto-rotate to locked mode.
@@ -799,9 +810,6 @@ public class NavigationBar extends ViewController<NavigationBarView> implements

    @Override
    public void onViewDetached() {
        final RotationButtonController rotationButtonController =
                mView.getRotationButtonController();
        rotationButtonController.setRotationCallback(null);
        mView.setUpdateActiveTouchRegionsCallback(null);
        getBarTransitions().destroy();
        mOverviewProxyService.removeCallback(mOverviewProxyListener);
@@ -1487,6 +1495,7 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
    }

    void updateAccessibilityStateFlags() {
        mLongPressHomeEnabled = mNavBarHelper.getLongPressHomeEnabled();
        if (mView != null) {
            int a11yFlags = mNavBarHelper.getA11yButtonState();
            boolean clickable = (a11yFlags & SYSUI_STATE_A11Y_BUTTON_CLICKABLE) != 0;
@@ -1702,12 +1711,6 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
        return mNavBarMode == NAV_BAR_MODE_GESTURAL && mOrientationHandle != null;
    }

    private final Consumer<Integer> mRotationWatcher = rotation -> {
        if (mView != null && mView.needsReorient(rotation)) {
            repositionNavigationBar(rotation);
        }
    };

    private final UserTracker.Callback mUserChangedCallback =
            new UserTracker.Callback() {
                @Override
+9 −2

File changed.

Preview size limit exceeded, changes collapsed.

+5 −43

File changed.

Preview size limit exceeded, changes collapsed.

Loading