Loading packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarOverlayController.java +3 −1 Original line number Original line Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.navigationbar; package com.android.systemui.navigationbar; import android.content.Context; import android.content.Context; import android.graphics.Rect; import android.view.View; import android.view.View; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.dagger.SysUISingleton; Loading Loading @@ -47,7 +48,8 @@ public class NavigationBarOverlayController { /** /** * Initialize the controller with visibility change callback. * Initialize the controller with visibility change callback. */ */ public void init(Consumer<Boolean> visibilityChangeCallback) {} public void init(Consumer<Boolean> visibilityChangeCallback, Consumer<Rect> excludeBackRegionCallback) {} /** /** * Set whether the view can be shown. * Set whether the view can be shown. Loading packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java +6 −4 Original line number Original line Diff line number Diff line Loading @@ -323,10 +323,6 @@ public class NavigationBarView extends FrameLayout implements mOverviewProxyService = Dependency.get(OverviewProxyService.class); mOverviewProxyService = Dependency.get(OverviewProxyService.class); mRecentsOnboarding = new RecentsOnboarding(context, mOverviewProxyService); mRecentsOnboarding = new RecentsOnboarding(context, mOverviewProxyService); mNavBarOverlayController = Dependency.get(NavigationBarOverlayController.class); if (mNavBarOverlayController.isNavigationBarOverlayEnabled()) { mNavBarOverlayController.init(mNavbarOverlayVisibilityChangeCallback); } mConfiguration = new Configuration(); mConfiguration = new Configuration(); mTmpLastConfiguration = new Configuration(); mTmpLastConfiguration = new Configuration(); Loading Loading @@ -371,6 +367,12 @@ public class NavigationBarView extends FrameLayout implements return isGesturalModeOnDefaultDisplay(getContext(), mNavBarMode); return isGesturalModeOnDefaultDisplay(getContext(), mNavBarMode); } } }); }); mNavBarOverlayController = Dependency.get(NavigationBarOverlayController.class); if (mNavBarOverlayController.isNavigationBarOverlayEnabled()) { mNavBarOverlayController.init(mNavbarOverlayVisibilityChangeCallback, mEdgeBackGestureHandler::updateNavigationBarOverlayExcludeRegion); } } } public void setAutoHideController(AutoHideController autoHideController) { public void setAutoHideController(AutoHideController autoHideController) { Loading packages/SystemUI/src/com/android/systemui/navigationbar/gestural/EdgeBackGestureHandler.java +9 −2 Original line number Original line Diff line number Diff line Loading @@ -187,6 +187,7 @@ public class EdgeBackGestureHandler extends CurrentUserTracker private final Executor mMainExecutor; private final Executor mMainExecutor; private final Rect mPipExcludedBounds = new Rect(); private final Rect mPipExcludedBounds = new Rect(); private final Rect mNavBarOverlayExcludedBounds = new Rect(); private final Region mExcludeRegion = new Region(); private final Region mExcludeRegion = new Region(); private final Region mUnrestrictedExcludeRegion = new Region(); private final Region mUnrestrictedExcludeRegion = new Region(); Loading Loading @@ -366,6 +367,10 @@ public class EdgeBackGestureHandler extends CurrentUserTracker mTouchSlop = mViewConfiguration.getScaledTouchSlop() * backGestureSlop; mTouchSlop = mViewConfiguration.getScaledTouchSlop() * backGestureSlop; } } public void updateNavigationBarOverlayExcludeRegion(Rect exclude) { mNavBarOverlayExcludedBounds.set(exclude); } private void onNavigationSettingsChanged() { private void onNavigationSettingsChanged() { boolean wasBackAllowed = isHandlingGestures(); boolean wasBackAllowed = isHandlingGestures(); updateCurrentUserResources(); updateCurrentUserResources(); Loading Loading @@ -629,8 +634,9 @@ public class EdgeBackGestureHandler extends CurrentUserTracker return false; return false; } } // If the point is inside the PiP excluded bounds, then drop it. // If the point is inside the PiP or Nav bar overlay excluded bounds, then ignore the back if (mPipExcludedBounds.contains(x, y)) { // gesture if (mPipExcludedBounds.contains(x, y) || mNavBarOverlayExcludedBounds.contains(x, y)) { return false; return false; } } Loading Loading @@ -893,6 +899,7 @@ public class EdgeBackGestureHandler extends CurrentUserTracker pw.println(" mExcludeRegion=" + mExcludeRegion); pw.println(" mExcludeRegion=" + mExcludeRegion); pw.println(" mUnrestrictedExcludeRegion=" + mUnrestrictedExcludeRegion); pw.println(" mUnrestrictedExcludeRegion=" + mUnrestrictedExcludeRegion); pw.println(" mPipExcludedBounds=" + mPipExcludedBounds); pw.println(" mPipExcludedBounds=" + mPipExcludedBounds); pw.println(" mNavBarOverlayExcludedBounds=" + mNavBarOverlayExcludedBounds); pw.println(" mEdgeWidthLeft=" + mEdgeWidthLeft); pw.println(" mEdgeWidthLeft=" + mEdgeWidthLeft); pw.println(" mEdgeWidthRight=" + mEdgeWidthRight); pw.println(" mEdgeWidthRight=" + mEdgeWidthRight); pw.println(" mLeftInset=" + mLeftInset); pw.println(" mLeftInset=" + mLeftInset); Loading Loading
packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarOverlayController.java +3 −1 Original line number Original line Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.navigationbar; package com.android.systemui.navigationbar; import android.content.Context; import android.content.Context; import android.graphics.Rect; import android.view.View; import android.view.View; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.dagger.SysUISingleton; Loading Loading @@ -47,7 +48,8 @@ public class NavigationBarOverlayController { /** /** * Initialize the controller with visibility change callback. * Initialize the controller with visibility change callback. */ */ public void init(Consumer<Boolean> visibilityChangeCallback) {} public void init(Consumer<Boolean> visibilityChangeCallback, Consumer<Rect> excludeBackRegionCallback) {} /** /** * Set whether the view can be shown. * Set whether the view can be shown. Loading
packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java +6 −4 Original line number Original line Diff line number Diff line Loading @@ -323,10 +323,6 @@ public class NavigationBarView extends FrameLayout implements mOverviewProxyService = Dependency.get(OverviewProxyService.class); mOverviewProxyService = Dependency.get(OverviewProxyService.class); mRecentsOnboarding = new RecentsOnboarding(context, mOverviewProxyService); mRecentsOnboarding = new RecentsOnboarding(context, mOverviewProxyService); mNavBarOverlayController = Dependency.get(NavigationBarOverlayController.class); if (mNavBarOverlayController.isNavigationBarOverlayEnabled()) { mNavBarOverlayController.init(mNavbarOverlayVisibilityChangeCallback); } mConfiguration = new Configuration(); mConfiguration = new Configuration(); mTmpLastConfiguration = new Configuration(); mTmpLastConfiguration = new Configuration(); Loading Loading @@ -371,6 +367,12 @@ public class NavigationBarView extends FrameLayout implements return isGesturalModeOnDefaultDisplay(getContext(), mNavBarMode); return isGesturalModeOnDefaultDisplay(getContext(), mNavBarMode); } } }); }); mNavBarOverlayController = Dependency.get(NavigationBarOverlayController.class); if (mNavBarOverlayController.isNavigationBarOverlayEnabled()) { mNavBarOverlayController.init(mNavbarOverlayVisibilityChangeCallback, mEdgeBackGestureHandler::updateNavigationBarOverlayExcludeRegion); } } } public void setAutoHideController(AutoHideController autoHideController) { public void setAutoHideController(AutoHideController autoHideController) { Loading
packages/SystemUI/src/com/android/systemui/navigationbar/gestural/EdgeBackGestureHandler.java +9 −2 Original line number Original line Diff line number Diff line Loading @@ -187,6 +187,7 @@ public class EdgeBackGestureHandler extends CurrentUserTracker private final Executor mMainExecutor; private final Executor mMainExecutor; private final Rect mPipExcludedBounds = new Rect(); private final Rect mPipExcludedBounds = new Rect(); private final Rect mNavBarOverlayExcludedBounds = new Rect(); private final Region mExcludeRegion = new Region(); private final Region mExcludeRegion = new Region(); private final Region mUnrestrictedExcludeRegion = new Region(); private final Region mUnrestrictedExcludeRegion = new Region(); Loading Loading @@ -366,6 +367,10 @@ public class EdgeBackGestureHandler extends CurrentUserTracker mTouchSlop = mViewConfiguration.getScaledTouchSlop() * backGestureSlop; mTouchSlop = mViewConfiguration.getScaledTouchSlop() * backGestureSlop; } } public void updateNavigationBarOverlayExcludeRegion(Rect exclude) { mNavBarOverlayExcludedBounds.set(exclude); } private void onNavigationSettingsChanged() { private void onNavigationSettingsChanged() { boolean wasBackAllowed = isHandlingGestures(); boolean wasBackAllowed = isHandlingGestures(); updateCurrentUserResources(); updateCurrentUserResources(); Loading Loading @@ -629,8 +634,9 @@ public class EdgeBackGestureHandler extends CurrentUserTracker return false; return false; } } // If the point is inside the PiP excluded bounds, then drop it. // If the point is inside the PiP or Nav bar overlay excluded bounds, then ignore the back if (mPipExcludedBounds.contains(x, y)) { // gesture if (mPipExcludedBounds.contains(x, y) || mNavBarOverlayExcludedBounds.contains(x, y)) { return false; return false; } } Loading Loading @@ -893,6 +899,7 @@ public class EdgeBackGestureHandler extends CurrentUserTracker pw.println(" mExcludeRegion=" + mExcludeRegion); pw.println(" mExcludeRegion=" + mExcludeRegion); pw.println(" mUnrestrictedExcludeRegion=" + mUnrestrictedExcludeRegion); pw.println(" mUnrestrictedExcludeRegion=" + mUnrestrictedExcludeRegion); pw.println(" mPipExcludedBounds=" + mPipExcludedBounds); pw.println(" mPipExcludedBounds=" + mPipExcludedBounds); pw.println(" mNavBarOverlayExcludedBounds=" + mNavBarOverlayExcludedBounds); pw.println(" mEdgeWidthLeft=" + mEdgeWidthLeft); pw.println(" mEdgeWidthLeft=" + mEdgeWidthLeft); pw.println(" mEdgeWidthRight=" + mEdgeWidthRight); pw.println(" mEdgeWidthRight=" + mEdgeWidthRight); pw.println(" mLeftInset=" + mLeftInset); pw.println(" mLeftInset=" + mLeftInset); Loading