Loading libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimation.java +20 −0 Original line number Diff line number Diff line Loading @@ -107,4 +107,24 @@ public interface BackAnimation { * @param pilferCallback the callback to pilfer pointers. */ void setPilferPointerCallback(Runnable pilferCallback); /** * Set a callback to requestTopUi. * @param topUiRequest the callback to requestTopUi. */ void setTopUiRequestCallback(TopUiRequest topUiRequest); /** * Callback to request SysUi to call * {@link android.app.IActivityManager#setHasTopUi(boolean)}. */ interface TopUiRequest { /** * Request {@link android.app.IActivityManager#setHasTopUi(boolean)} to be called. * @param requestTopUi whether topUi should be requested or not * @param tag tag of the request-source */ void requestTopUi(boolean requestTopUi, String tag); } } libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java +15 −0 Original line number Diff line number Diff line Loading @@ -179,6 +179,7 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont @BackNavigationInfo.BackTargetType private int mPreviousNavigationType; private Runnable mPilferPointerCallback; private BackAnimation.TopUiRequest mRequestTopUiCallback; public BackAnimationController( @NonNull ShellInit shellInit, Loading Loading @@ -357,6 +358,11 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont mPilferPointerCallback = callback; }); } @Override public void setTopUiRequestCallback(TopUiRequest topUiRequest) { mShellExecutor.execute(() -> mRequestTopUiCallback = topUiRequest); } } private static class IBackAnimationImpl extends IBackAnimation.Stub Loading Loading @@ -557,6 +563,7 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont if (!mShellBackAnimationRegistry.startGesture(backType)) { mActiveCallback = null; } requestTopUi(true, backType); tryPilferPointers(); } else { mActiveCallback = mBackNavigationInfo.getOnBackInvokedCallback(); Loading Loading @@ -906,6 +913,7 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont mPreviousNavigationType = mBackNavigationInfo.getType(); mBackNavigationInfo.onBackNavigationFinished(triggerBack); mBackNavigationInfo = null; requestTopUi(false, mPreviousNavigationType); } } Loading Loading @@ -969,6 +977,13 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont } } private void requestTopUi(boolean hasTopUi, int backType) { if (mRequestTopUiCallback != null && (backType == BackNavigationInfo.TYPE_CROSS_TASK || backType == BackNavigationInfo.TYPE_CROSS_ACTIVITY)) { mRequestTopUiCallback.requestTopUi(hasTopUi, TAG); } } /** * Validate animation targets. */ Loading packages/SystemUI/src/com/android/systemui/navigationbar/gestural/EdgeBackGestureHandler.java +14 −3 Original line number Diff line number Diff line Loading @@ -91,6 +91,7 @@ import com.android.systemui.shared.system.QuickStepContract.SystemUiStateFlags; import com.android.systemui.shared.system.SysUiStatsLog; import com.android.systemui.shared.system.TaskStackChangeListener; import com.android.systemui.shared.system.TaskStackChangeListeners; import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.phone.LightBarController; import com.android.systemui.util.concurrency.BackPanelUiThread; import com.android.systemui.util.concurrency.UiThreadContext; Loading Loading @@ -297,6 +298,7 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack private Date mTmpLogDate = new Date(); private final GestureNavigationSettingsObserver mGestureNavigationSettingsObserver; private final NotificationShadeWindowController mNotificationShadeWindowController; private final NavigationEdgeBackPlugin.BackCallback mBackCallback = new NavigationEdgeBackPlugin.BackCallback() { Loading Loading @@ -423,7 +425,8 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack Optional<DesktopMode> desktopModeOptional, FalsingManager falsingManager, Provider<BackGestureTfClassifierProvider> backGestureTfClassifierProviderProvider, Provider<LightBarController> lightBarControllerProvider) { Provider<LightBarController> lightBarControllerProvider, NotificationShadeWindowController notificationShadeWindowController) { mContext = context; mDisplayId = context.getDisplayId(); mUiThreadContext = uiThreadContext; Loading Loading @@ -479,6 +482,7 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack this::onNavigationSettingsChanged); updateCurrentUserResources(); mNotificationShadeWindowController = notificationShadeWindowController; } public void setStateChangeCallback(Runnable callback) { Loading Loading @@ -1297,6 +1301,9 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack mBackAnimation.setPilferPointerCallback(() -> { pilferPointers(); }); mBackAnimation.setTopUiRequestCallback( (requestTopUi, tag) -> mUiThreadContext.getExecutor().execute(() -> mNotificationShadeWindowController.setRequestTopUi(requestTopUi, tag))); updateBackAnimationThresholds(); if (mLightBarControllerProvider.get() != null) { mBackAnimation.setStatusBarCustomizer((appearance) -> { Loading Loading @@ -1333,6 +1340,7 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack private final Provider<BackGestureTfClassifierProvider> mBackGestureTfClassifierProviderProvider; private final Provider<LightBarController> mLightBarControllerProvider; private final NotificationShadeWindowController mNotificationShadeWindowController; @Inject public Factory(OverviewProxyService overviewProxyService, Loading @@ -1353,7 +1361,8 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack FalsingManager falsingManager, Provider<BackGestureTfClassifierProvider> backGestureTfClassifierProviderProvider, Provider<LightBarController> lightBarControllerProvider) { Provider<LightBarController> lightBarControllerProvider, NotificationShadeWindowController notificationShadeWindowController) { mOverviewProxyService = overviewProxyService; mSysUiState = sysUiState; mPluginManager = pluginManager; Loading @@ -1372,6 +1381,7 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack mFalsingManager = falsingManager; mBackGestureTfClassifierProviderProvider = backGestureTfClassifierProviderProvider; mLightBarControllerProvider = lightBarControllerProvider; mNotificationShadeWindowController = notificationShadeWindowController; } /** Construct a {@link EdgeBackGestureHandler}. */ Loading @@ -1396,7 +1406,8 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack mDesktopModeOptional, mFalsingManager, mBackGestureTfClassifierProviderProvider, mLightBarControllerProvider)); mLightBarControllerProvider, mNotificationShadeWindowController)); } } Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimation.java +20 −0 Original line number Diff line number Diff line Loading @@ -107,4 +107,24 @@ public interface BackAnimation { * @param pilferCallback the callback to pilfer pointers. */ void setPilferPointerCallback(Runnable pilferCallback); /** * Set a callback to requestTopUi. * @param topUiRequest the callback to requestTopUi. */ void setTopUiRequestCallback(TopUiRequest topUiRequest); /** * Callback to request SysUi to call * {@link android.app.IActivityManager#setHasTopUi(boolean)}. */ interface TopUiRequest { /** * Request {@link android.app.IActivityManager#setHasTopUi(boolean)} to be called. * @param requestTopUi whether topUi should be requested or not * @param tag tag of the request-source */ void requestTopUi(boolean requestTopUi, String tag); } }
libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java +15 −0 Original line number Diff line number Diff line Loading @@ -179,6 +179,7 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont @BackNavigationInfo.BackTargetType private int mPreviousNavigationType; private Runnable mPilferPointerCallback; private BackAnimation.TopUiRequest mRequestTopUiCallback; public BackAnimationController( @NonNull ShellInit shellInit, Loading Loading @@ -357,6 +358,11 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont mPilferPointerCallback = callback; }); } @Override public void setTopUiRequestCallback(TopUiRequest topUiRequest) { mShellExecutor.execute(() -> mRequestTopUiCallback = topUiRequest); } } private static class IBackAnimationImpl extends IBackAnimation.Stub Loading Loading @@ -557,6 +563,7 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont if (!mShellBackAnimationRegistry.startGesture(backType)) { mActiveCallback = null; } requestTopUi(true, backType); tryPilferPointers(); } else { mActiveCallback = mBackNavigationInfo.getOnBackInvokedCallback(); Loading Loading @@ -906,6 +913,7 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont mPreviousNavigationType = mBackNavigationInfo.getType(); mBackNavigationInfo.onBackNavigationFinished(triggerBack); mBackNavigationInfo = null; requestTopUi(false, mPreviousNavigationType); } } Loading Loading @@ -969,6 +977,13 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont } } private void requestTopUi(boolean hasTopUi, int backType) { if (mRequestTopUiCallback != null && (backType == BackNavigationInfo.TYPE_CROSS_TASK || backType == BackNavigationInfo.TYPE_CROSS_ACTIVITY)) { mRequestTopUiCallback.requestTopUi(hasTopUi, TAG); } } /** * Validate animation targets. */ Loading
packages/SystemUI/src/com/android/systemui/navigationbar/gestural/EdgeBackGestureHandler.java +14 −3 Original line number Diff line number Diff line Loading @@ -91,6 +91,7 @@ import com.android.systemui.shared.system.QuickStepContract.SystemUiStateFlags; import com.android.systemui.shared.system.SysUiStatsLog; import com.android.systemui.shared.system.TaskStackChangeListener; import com.android.systemui.shared.system.TaskStackChangeListeners; import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.phone.LightBarController; import com.android.systemui.util.concurrency.BackPanelUiThread; import com.android.systemui.util.concurrency.UiThreadContext; Loading Loading @@ -297,6 +298,7 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack private Date mTmpLogDate = new Date(); private final GestureNavigationSettingsObserver mGestureNavigationSettingsObserver; private final NotificationShadeWindowController mNotificationShadeWindowController; private final NavigationEdgeBackPlugin.BackCallback mBackCallback = new NavigationEdgeBackPlugin.BackCallback() { Loading Loading @@ -423,7 +425,8 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack Optional<DesktopMode> desktopModeOptional, FalsingManager falsingManager, Provider<BackGestureTfClassifierProvider> backGestureTfClassifierProviderProvider, Provider<LightBarController> lightBarControllerProvider) { Provider<LightBarController> lightBarControllerProvider, NotificationShadeWindowController notificationShadeWindowController) { mContext = context; mDisplayId = context.getDisplayId(); mUiThreadContext = uiThreadContext; Loading Loading @@ -479,6 +482,7 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack this::onNavigationSettingsChanged); updateCurrentUserResources(); mNotificationShadeWindowController = notificationShadeWindowController; } public void setStateChangeCallback(Runnable callback) { Loading Loading @@ -1297,6 +1301,9 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack mBackAnimation.setPilferPointerCallback(() -> { pilferPointers(); }); mBackAnimation.setTopUiRequestCallback( (requestTopUi, tag) -> mUiThreadContext.getExecutor().execute(() -> mNotificationShadeWindowController.setRequestTopUi(requestTopUi, tag))); updateBackAnimationThresholds(); if (mLightBarControllerProvider.get() != null) { mBackAnimation.setStatusBarCustomizer((appearance) -> { Loading Loading @@ -1333,6 +1340,7 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack private final Provider<BackGestureTfClassifierProvider> mBackGestureTfClassifierProviderProvider; private final Provider<LightBarController> mLightBarControllerProvider; private final NotificationShadeWindowController mNotificationShadeWindowController; @Inject public Factory(OverviewProxyService overviewProxyService, Loading @@ -1353,7 +1361,8 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack FalsingManager falsingManager, Provider<BackGestureTfClassifierProvider> backGestureTfClassifierProviderProvider, Provider<LightBarController> lightBarControllerProvider) { Provider<LightBarController> lightBarControllerProvider, NotificationShadeWindowController notificationShadeWindowController) { mOverviewProxyService = overviewProxyService; mSysUiState = sysUiState; mPluginManager = pluginManager; Loading @@ -1372,6 +1381,7 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack mFalsingManager = falsingManager; mBackGestureTfClassifierProviderProvider = backGestureTfClassifierProviderProvider; mLightBarControllerProvider = lightBarControllerProvider; mNotificationShadeWindowController = notificationShadeWindowController; } /** Construct a {@link EdgeBackGestureHandler}. */ Loading @@ -1396,7 +1406,8 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack mDesktopModeOptional, mFalsingManager, mBackGestureTfClassifierProviderProvider, mLightBarControllerProvider)); mLightBarControllerProvider, mNotificationShadeWindowController)); } } Loading