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

Commit d305e200 authored by Sunny Goyal's avatar Sunny Goyal Committed by Automerger Merge Worker
Browse files

Merge "Removing back-button alpha controlling logic" into tm-qpr-dev am: 1c02d77c

parents ab285c37 1c02d77c
Loading
Loading
Loading
Loading
+0 −3
Original line number Original line Diff line number Diff line
@@ -35,9 +35,6 @@
    <!-- How many lines to show in the security footer -->
    <!-- How many lines to show in the security footer -->
    <integer name="qs_security_footer_maxLines">1</integer>
    <integer name="qs_security_footer_maxLines">1</integer>


    <!-- Determines whether to allow the nav bar handle to be forced to be opaque. -->
    <bool name="allow_force_nav_bar_handle_opaque">false</bool>

    <bool name="config_use_large_screen_shade_header">true</bool>
    <bool name="config_use_large_screen_shade_header">true</bool>


    <!-- Whether to show the side fps hint while on bouncer -->
    <!-- Whether to show the side fps hint while on bouncer -->
+0 −3
Original line number Original line Diff line number Diff line
@@ -587,9 +587,6 @@
         when the double-press power gesture is used. Ignored if empty. -->
         when the double-press power gesture is used. Ignored if empty. -->
    <string translatable="false" name="config_cameraGesturePackage"></string>
    <string translatable="false" name="config_cameraGesturePackage"></string>


    <!-- Determines whether to allow the nav bar handle to be forced to be opaque. -->
    <bool name="allow_force_nav_bar_handle_opaque">true</bool>

    <!-- Whether a transition of ACTIVITY_TYPE_DREAM to the home app should play a home sound
    <!-- Whether a transition of ACTIVITY_TYPE_DREAM to the home app should play a home sound
         effect -->
         effect -->
    <bool name="config_playHomeSoundAfterDream">false</bool>
    <bool name="config_playHomeSoundAfterDream">false</bool>
+0 −7
Original line number Original line Diff line number Diff line
@@ -41,13 +41,6 @@ interface ISystemUiProxy {
     */
     */
    void onOverviewShown(boolean fromHome) = 6;
    void onOverviewShown(boolean fromHome) = 6;


    /**
     * Control the {@param alpha} of the option nav bar button (back-button in 2 button mode
     * and home handle & background in gestural mode).  The {@param animate} is currently only
     * supported for 2 button mode.
     */
    void setNavBarButtonAlpha(float alpha, boolean animate) = 19;

    /**
    /**
     * Proxies motion events from the homescreen UI to the status bar. Only called when
     * Proxies motion events from the homescreen UI to the status bar. Only called when
     * swipe down is detected on WORKSPACE. The sender guarantees the following order of events on
     * swipe down is detected on WORKSPACE. The sender guarantees the following order of events on
+2 −59
Original line number Original line Diff line number Diff line
@@ -35,7 +35,6 @@ import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL;


import static com.android.internal.accessibility.common.ShortcutConstants.CHOOSER_PACKAGE_NAME;
import static com.android.internal.accessibility.common.ShortcutConstants.CHOOSER_PACKAGE_NAME;
import static com.android.internal.config.sysui.SystemUiDeviceConfigFlags.HOME_BUTTON_LONG_PRESS_DURATION_MS;
import static com.android.internal.config.sysui.SystemUiDeviceConfigFlags.HOME_BUTTON_LONG_PRESS_DURATION_MS;
import static com.android.internal.config.sysui.SystemUiDeviceConfigFlags.NAV_BAR_HANDLE_FORCE_OPAQUE;
import static com.android.systemui.navigationbar.NavBarHelper.transitionMode;
import static com.android.systemui.navigationbar.NavBarHelper.transitionMode;
import static com.android.systemui.recents.OverviewProxyService.OverviewProxyListener;
import static com.android.systemui.recents.OverviewProxyService.OverviewProxyListener;
import static com.android.systemui.shared.recents.utilities.Utilities.isTablet;
import static com.android.systemui.shared.recents.utilities.Utilities.isTablet;
@@ -229,10 +228,7 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
    private Locale mLocale;
    private Locale mLocale;
    private int mLayoutDirection;
    private int mLayoutDirection;


    private boolean mAllowForceNavBarHandleOpaque;
    private boolean mForceNavBarHandleOpaque;
    private Optional<Long> mHomeButtonLongPressDurationMs;
    private Optional<Long> mHomeButtonLongPressDurationMs;
    private boolean mIsCurrentUserSetup;


    /** @see android.view.WindowInsetsController#setSystemBarsAppearance(int, int) */
    /** @see android.view.WindowInsetsController#setSystemBarsAppearance(int, int) */
    private @Appearance int mAppearance;
    private @Appearance int mAppearance;
@@ -378,37 +374,6 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
            mAssistManagerLazy.get().startAssist(bundle);
            mAssistManagerLazy.get().startAssist(bundle);
        }
        }


        @Override
        public void onNavBarButtonAlphaChanged(float alpha, boolean animate) {
            if (!mIsCurrentUserSetup) {
                // If the current user is not yet setup, then don't update any button alphas
                return;
            }
            if (QuickStepContract.isLegacyMode(mNavBarMode)) {
                // Don't allow the bar buttons to be affected by the alpha
                return;
            }

            ButtonDispatcher buttonDispatcher = null;
            boolean forceVisible = false;
            if (QuickStepContract.isGesturalMode(mNavBarMode)) {
                // Disallow home handle animations when in gestural
                animate = false;
                forceVisible = mAllowForceNavBarHandleOpaque && mForceNavBarHandleOpaque;
                buttonDispatcher = mView.getHomeHandle();
                if (getBarTransitions() != null) {
                    getBarTransitions().setBackgroundOverrideAlpha(alpha);
                }
            } else if (QuickStepContract.isSwipeUpMode(mNavBarMode)) {
                buttonDispatcher = mView.getBackButton();
            }
            if (buttonDispatcher != null) {
                buttonDispatcher.setVisibility(
                        (forceVisible || alpha > 0) ? View.VISIBLE : View.INVISIBLE);
                buttonDispatcher.setAlpha(forceVisible ? 1f : alpha, animate);
            }
        }

        @Override
        @Override
        public void onHomeRotationEnabled(boolean enabled) {
        public void onHomeRotationEnabled(boolean enabled) {
            mView.getRotationButtonController().setHomeRotationEnabled(enabled);
            mView.getRotationButtonController().setHomeRotationEnabled(enabled);
@@ -456,15 +421,10 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
            new DeviceConfig.OnPropertiesChangedListener() {
            new DeviceConfig.OnPropertiesChangedListener() {
                @Override
                @Override
                public void onPropertiesChanged(DeviceConfig.Properties properties) {
                public void onPropertiesChanged(DeviceConfig.Properties properties) {
                    if (properties.getKeyset().contains(NAV_BAR_HANDLE_FORCE_OPAQUE)) {
                        mForceNavBarHandleOpaque = properties.getBoolean(
                                NAV_BAR_HANDLE_FORCE_OPAQUE, /* defaultValue = */ true);
                    }

                    if (properties.getKeyset().contains(HOME_BUTTON_LONG_PRESS_DURATION_MS)) {
                    if (properties.getKeyset().contains(HOME_BUTTON_LONG_PRESS_DURATION_MS)) {
                        mHomeButtonLongPressDurationMs = Optional.of(
                        mHomeButtonLongPressDurationMs = Optional.of(
                            properties.getLong(HOME_BUTTON_LONG_PRESS_DURATION_MS, 0)
                            properties.getLong(HOME_BUTTON_LONG_PRESS_DURATION_MS, 0))
                        ).filter(duration -> duration != 0);
                                .filter(duration -> duration != 0);
                        if (mView != null) {
                        if (mView != null) {
                            reconfigureHomeLongClick();
                            reconfigureHomeLongClick();
                        }
                        }
@@ -472,14 +432,6 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
                }
                }
            };
            };


    private final DeviceProvisionedController.DeviceProvisionedListener mUserSetupListener =
            new DeviceProvisionedController.DeviceProvisionedListener() {
                @Override
                public void onUserSetupChanged() {
                    mIsCurrentUserSetup = mDeviceProvisionedController.isCurrentUserSetup();
                }
            };

    private final NotificationShadeDepthController.DepthListener mDepthListener =
    private final NotificationShadeDepthController.DepthListener mDepthListener =
            new NotificationShadeDepthController.DepthListener() {
            new NotificationShadeDepthController.DepthListener() {
                boolean mHasBlurs;
                boolean mHasBlurs;
@@ -660,12 +612,6 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
        mCommandQueue.addCallback(this);
        mCommandQueue.addCallback(this);
        mLongPressHomeEnabled = mNavBarHelper.getLongPressHomeEnabled();
        mLongPressHomeEnabled = mNavBarHelper.getLongPressHomeEnabled();
        mNavBarHelper.init();
        mNavBarHelper.init();
        mAllowForceNavBarHandleOpaque = mContext.getResources().getBoolean(
                R.bool.allow_force_nav_bar_handle_opaque);
        mForceNavBarHandleOpaque = mDeviceConfigProxy.getBoolean(
                DeviceConfig.NAMESPACE_SYSTEMUI,
                NAV_BAR_HANDLE_FORCE_OPAQUE,
                /* defaultValue = */ true);
        mHomeButtonLongPressDurationMs = Optional.of(mDeviceConfigProxy.getLong(
        mHomeButtonLongPressDurationMs = Optional.of(mDeviceConfigProxy.getLong(
                DeviceConfig.NAMESPACE_SYSTEMUI,
                DeviceConfig.NAMESPACE_SYSTEMUI,
                HOME_BUTTON_LONG_PRESS_DURATION_MS,
                HOME_BUTTON_LONG_PRESS_DURATION_MS,
@@ -685,8 +631,6 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
        // Respect the latest disabled-flags.
        // Respect the latest disabled-flags.
        mCommandQueue.recomputeDisableFlags(mDisplayId, false);
        mCommandQueue.recomputeDisableFlags(mDisplayId, false);


        mIsCurrentUserSetup = mDeviceProvisionedController.isCurrentUserSetup();
        mDeviceProvisionedController.addCallback(mUserSetupListener);
        mNotificationShadeDepthController.addListener(mDepthListener);
        mNotificationShadeDepthController.addListener(mDepthListener);
    }
    }


@@ -698,7 +642,6 @@ public class NavigationBar extends ViewController<NavigationBarView> implements


        mNavBarHelper.removeNavTaskStateUpdater(mNavbarTaskbarStateUpdater);
        mNavBarHelper.removeNavTaskStateUpdater(mNavbarTaskbarStateUpdater);
        mNavBarHelper.destroy();
        mNavBarHelper.destroy();
        mDeviceProvisionedController.removeCallback(mUserSetupListener);
        mNotificationShadeDepthController.removeListener(mDepthListener);
        mNotificationShadeDepthController.removeListener(mDepthListener);


        mDeviceConfigProxy.removeOnPropertiesChangedListener(mOnPropertiesChangedListener);
        mDeviceConfigProxy.removeOnPropertiesChangedListener(mOnPropertiesChangedListener);
+0 −21
Original line number Original line Diff line number Diff line
@@ -175,7 +175,6 @@ public class OverviewProxyService extends CurrentUserTracker implements
    private boolean mBound;
    private boolean mBound;
    private boolean mIsEnabled;
    private boolean mIsEnabled;
    private int mCurrentBoundedUserId = -1;
    private int mCurrentBoundedUserId = -1;
    private float mNavBarButtonAlpha;
    private boolean mInputFocusTransferStarted;
    private boolean mInputFocusTransferStarted;
    private float mInputFocusTransferStartY;
    private float mInputFocusTransferStartY;
    private long mInputFocusTransferStartMillis;
    private long mInputFocusTransferStartMillis;
@@ -296,12 +295,6 @@ public class OverviewProxyService extends CurrentUserTracker implements
            });
            });
        }
        }


        @Override
        public void setNavBarButtonAlpha(float alpha, boolean animate) {
            verifyCallerAndClearCallingIdentityPostMain("setNavBarButtonAlpha", () ->
                    notifyNavBarButtonAlphaChanged(alpha, animate));
        }

        @Override
        @Override
        public void onAssistantProgress(@FloatRange(from = 0.0, to = 1.0) float progress) {
        public void onAssistantProgress(@FloatRange(from = 0.0, to = 1.0) float progress) {
            verifyCallerAndClearCallingIdentityPostMain("onAssistantProgress", () ->
            verifyCallerAndClearCallingIdentityPostMain("onAssistantProgress", () ->
@@ -610,9 +603,6 @@ public class OverviewProxyService extends CurrentUserTracker implements
        mBackAnimation = backAnimation;
        mBackAnimation = backAnimation;
        mUiEventLogger = uiEventLogger;
        mUiEventLogger = uiEventLogger;


        // Assumes device always starts with back button until launcher tells it that it does not
        mNavBarButtonAlpha = 1.0f;

        dumpManager.registerDumpable(getClass().getSimpleName(), this);
        dumpManager.registerDumpable(getClass().getSimpleName(), this);


        // Listen for nav bar mode changes
        // Listen for nav bar mode changes
@@ -814,7 +804,6 @@ public class OverviewProxyService extends CurrentUserTracker implements
            mConnectionCallbacks.add(listener);
            mConnectionCallbacks.add(listener);
        }
        }
        listener.onConnectionChanged(mOverviewProxy != null);
        listener.onConnectionChanged(mOverviewProxy != null);
        listener.onNavBarButtonAlphaChanged(mNavBarButtonAlpha, false);
    }
    }


    @Override
    @Override
@@ -844,17 +833,10 @@ public class OverviewProxyService extends CurrentUserTracker implements
        if (mOverviewProxy != null) {
        if (mOverviewProxy != null) {
            mOverviewProxy.asBinder().unlinkToDeath(mOverviewServiceDeathRcpt, 0);
            mOverviewProxy.asBinder().unlinkToDeath(mOverviewServiceDeathRcpt, 0);
            mOverviewProxy = null;
            mOverviewProxy = null;
            notifyNavBarButtonAlphaChanged(1f, false /* animate */);
            notifyConnectionChanged();
            notifyConnectionChanged();
        }
        }
    }
    }


    private void notifyNavBarButtonAlphaChanged(float alpha, boolean animate) {
        for (int i = mConnectionCallbacks.size() - 1; i >= 0; --i) {
            mConnectionCallbacks.get(i).onNavBarButtonAlphaChanged(alpha, animate);
        }
    }

    private void notifyHomeRotationEnabled(boolean enabled) {
    private void notifyHomeRotationEnabled(boolean enabled) {
        for (int i = mConnectionCallbacks.size() - 1; i >= 0; --i) {
        for (int i = mConnectionCallbacks.size() - 1; i >= 0; --i) {
            mConnectionCallbacks.get(i).onHomeRotationEnabled(enabled);
            mConnectionCallbacks.get(i).onHomeRotationEnabled(enabled);
@@ -1083,7 +1065,6 @@ public class OverviewProxyService extends CurrentUserTracker implements
        pw.print("  mInputFocusTransferStartMillis="); pw.println(mInputFocusTransferStartMillis);
        pw.print("  mInputFocusTransferStartMillis="); pw.println(mInputFocusTransferStartMillis);
        pw.print("  mWindowCornerRadius="); pw.println(mWindowCornerRadius);
        pw.print("  mWindowCornerRadius="); pw.println(mWindowCornerRadius);
        pw.print("  mSupportsRoundedCornersOnWindows="); pw.println(mSupportsRoundedCornersOnWindows);
        pw.print("  mSupportsRoundedCornersOnWindows="); pw.println(mSupportsRoundedCornersOnWindows);
        pw.print("  mNavBarButtonAlpha="); pw.println(mNavBarButtonAlpha);
        pw.print("  mActiveNavBarRegion="); pw.println(mActiveNavBarRegion);
        pw.print("  mActiveNavBarRegion="); pw.println(mActiveNavBarRegion);
        pw.print("  mNavBarMode="); pw.println(mNavBarMode);
        pw.print("  mNavBarMode="); pw.println(mNavBarMode);
        mSysUiState.dump(pw, args);
        mSysUiState.dump(pw, args);
@@ -1098,8 +1079,6 @@ public class OverviewProxyService extends CurrentUserTracker implements
        default void onQuickScrubStarted() {}
        default void onQuickScrubStarted() {}
        /** Notify the recents app (overview) is started by 3-button navigation. */
        /** Notify the recents app (overview) is started by 3-button navigation. */
        default void onToggleRecentApps() {}
        default void onToggleRecentApps() {}
        /** Notify changes in the nav bar button alpha */
        default void onNavBarButtonAlphaChanged(float alpha, boolean animate) {}
        default void onHomeRotationEnabled(boolean enabled) {}
        default void onHomeRotationEnabled(boolean enabled) {}
        default void onTaskbarStatusUpdated(boolean visible, boolean stashed) {}
        default void onTaskbarStatusUpdated(boolean visible, boolean stashed) {}
        default void onTaskbarAutohideSuspend(boolean suspend) {}
        default void onTaskbarAutohideSuspend(boolean suspend) {}