diff options
21 files changed, 51 insertions, 81 deletions
diff --git a/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/ShellSharedConstants.java b/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/ShellSharedConstants.java index 8f7a2e5a6789..01d2201a5a0c 100644 --- a/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/ShellSharedConstants.java +++ b/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/ShellSharedConstants.java @@ -20,29 +20,6 @@ package com.android.wm.shell.shared; * General shell-related constants that are shared with users of the library. */ public class ShellSharedConstants { - // See IPip.aidl - public static final String KEY_EXTRA_SHELL_PIP = "extra_shell_pip"; - // See IBubbles.aidl - public static final String KEY_EXTRA_SHELL_BUBBLES = "extra_shell_bubbles"; - // See ISplitScreen.aidl - public static final String KEY_EXTRA_SHELL_SPLIT_SCREEN = "extra_shell_split_screen"; - // See IOneHanded.aidl - public static final String KEY_EXTRA_SHELL_ONE_HANDED = "extra_shell_one_handed"; - // See IShellTransitions.aidl - public static final String KEY_EXTRA_SHELL_SHELL_TRANSITIONS = - "extra_shell_shell_transitions"; - // See IStartingWindow.aidl - public static final String KEY_EXTRA_SHELL_STARTING_WINDOW = - "extra_shell_starting_window"; - // See IRecentTasks.aidl - public static final String KEY_EXTRA_SHELL_RECENT_TASKS = "extra_shell_recent_tasks"; - // See IBackAnimation.aidl - public static final String KEY_EXTRA_SHELL_BACK_ANIMATION = "extra_shell_back_animation"; - // See IDesktopMode.aidl - public static final String KEY_EXTRA_SHELL_DESKTOP_MODE = "extra_shell_desktop_mode"; - // See IDragAndDrop.aidl - public static final String KEY_EXTRA_SHELL_DRAG_AND_DROP = "extra_shell_drag_and_drop"; - // See IRecentsAnimationController.aidl public static final String KEY_EXTRA_SHELL_CAN_HAND_OFF_ANIMATION = "extra_shell_can_hand_off_animation"; } diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java index e9cfd9bc2209..1383bd8e882a 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java @@ -32,7 +32,6 @@ import static com.android.window.flags.Flags.migratePredictiveBackTransition; import static com.android.window.flags.Flags.predictiveBackSystemAnims; import static com.android.window.flags.Flags.unifyBackNavigationTransition; import static com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_BACK_PREVIEW; -import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_BACK_ANIMATION; import android.annotation.NonNull; import android.annotation.Nullable; @@ -308,7 +307,7 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont setupAnimationDeveloperSettingsObserver(mContentResolver, mBgHandler); updateEnableAnimationFromFlags(); createAdapter(); - mShellController.addExternalInterface(KEY_EXTRA_SHELL_BACK_ANIMATION, + mShellController.addExternalInterface(IBackAnimation.DESCRIPTOR, this::createExternalInterface, this); mShellCommandHandler.addDumpCallback(this::dump, this); mShellController.addConfigurationChangeListener(this); diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java index 3b53c3fbe03f..bec73a1500a7 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java @@ -35,7 +35,6 @@ import static com.android.wm.shell.bubbles.Bubbles.DISMISS_PACKAGE_REMOVED; import static com.android.wm.shell.bubbles.Bubbles.DISMISS_SHORTCUT_REMOVED; import static com.android.wm.shell.bubbles.Bubbles.DISMISS_USER_CHANGED; import static com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_BUBBLES; -import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_BUBBLES; import android.annotation.BinderThread; import android.annotation.NonNull; @@ -522,7 +521,7 @@ public class BubbleController implements ConfigurationChangeListener, } mShellController.addConfigurationChangeListener(this); - mShellController.addExternalInterface(KEY_EXTRA_SHELL_BUBBLES, + mShellController.addExternalInterface(IBubbles.DESCRIPTOR, this::createExternalInterface, this); mShellCommandHandler.addDumpCallback(this::dump, this); } diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt index a94a40bc39f8..074a6e39304d 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt @@ -104,7 +104,6 @@ import com.android.wm.shell.recents.RecentsTransitionHandler import com.android.wm.shell.recents.RecentsTransitionStateListener import com.android.wm.shell.recents.RecentsTransitionStateListener.RecentsTransitionState import com.android.wm.shell.recents.RecentsTransitionStateListener.TRANSITION_STATE_NOT_RUNNING -import com.android.wm.shell.shared.ShellSharedConstants import com.android.wm.shell.shared.TransitionUtil import com.android.wm.shell.shared.annotations.ExternalThread import com.android.wm.shell.shared.annotations.ShellMainThread @@ -236,7 +235,7 @@ class DesktopTasksController( shellCommandHandler.addDumpCallback(this::dump, this) shellCommandHandler.addCommandCallback("desktopmode", desktopModeShellCommandHandler, this) shellController.addExternalInterface( - ShellSharedConstants.KEY_EXTRA_SHELL_DESKTOP_MODE, + IDesktopMode.DESCRIPTOR, { createExternalInterface() }, this, ) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragAndDropController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragAndDropController.java index 22e8dc186e9b..491b577386d7 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragAndDropController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragAndDropController.java @@ -31,8 +31,6 @@ import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_NO_MOVE_ANIMA import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_SHOW_FOR_ALL_USERS; import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY; -import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_DRAG_AND_DROP; - import android.app.ActivityManager; import android.app.ActivityTaskManager; import android.app.PendingIntent; @@ -167,7 +165,7 @@ public class DragAndDropController implements RemoteCallable<DragAndDropControll mMainExecutor.executeDelayed(() -> { mDisplayController.addDisplayWindowListener(this); }, 0); - mShellController.addExternalInterface(KEY_EXTRA_SHELL_DRAG_AND_DROP, + mShellController.addExternalInterface(IDragAndDrop.DESCRIPTOR, this::createExternalInterface, this); mShellTaskOrganizer.addTaskVanishedListener(this); mShellCommandHandler.addDumpCallback(this::dump, this); diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedController.java index 15472ebc149b..862520208d23 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedController.java @@ -23,7 +23,6 @@ import static com.android.wm.shell.onehanded.OneHandedState.STATE_ACTIVE; import static com.android.wm.shell.onehanded.OneHandedState.STATE_ENTERING; import static com.android.wm.shell.onehanded.OneHandedState.STATE_EXITING; import static com.android.wm.shell.onehanded.OneHandedState.STATE_NONE; -import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_ONE_HANDED; import android.annotation.BinderThread; import android.content.ComponentName; @@ -298,7 +297,7 @@ public class OneHandedController implements RemoteCallable<OneHandedController>, mShellController.addConfigurationChangeListener(this); mShellController.addKeyguardChangeListener(this); mShellController.addUserChangeListener(this); - mShellController.addExternalInterface(KEY_EXTRA_SHELL_ONE_HANDED, + mShellController.addExternalInterface(IOneHanded.DESCRIPTOR, this::createExternalInterface, this); } diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java index 588b88753eb9..582df486b2b3 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java @@ -32,7 +32,6 @@ import static com.android.wm.shell.pip.PipAnimationController.TRANSITION_DIRECTI import static com.android.wm.shell.pip.PipAnimationController.TRANSITION_DIRECTION_TO_PIP; import static com.android.wm.shell.pip.PipAnimationController.TRANSITION_DIRECTION_USER_RESIZE; import static com.android.wm.shell.pip.PipAnimationController.isOutPipDirection; -import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_PIP; import android.app.ActivityManager; import android.app.ActivityTaskManager; @@ -727,7 +726,7 @@ public class PipController implements PipTransitionController.PipTransitionCallb mShellController.addConfigurationChangeListener(this); mShellController.addKeyguardChangeListener(this); mShellController.addUserChangeListener(this); - mShellController.addExternalInterface(KEY_EXTRA_SHELL_PIP, + mShellController.addExternalInterface(IPip.DESCRIPTOR, this::createExternalInterface, this); } diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipController.java index 2c5d346224a3..19428ee39919 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipController.java @@ -20,8 +20,6 @@ import static android.app.WindowConfiguration.ROTATION_UNDEFINED; import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED; import static android.content.pm.PackageManager.FEATURE_PICTURE_IN_PICTURE; -import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_PIP; - import android.annotation.NonNull; import android.app.ActivityManager; import android.app.PictureInPictureParams; @@ -213,7 +211,7 @@ public class PipController implements ConfigurationChangeListener, }); // Allow other outside processes to bind to PiP controller using the key below. - mShellController.addExternalInterface(KEY_EXTRA_SHELL_PIP, + mShellController.addExternalInterface(IPip.DESCRIPTOR, this::createExternalInterface, this); mShellController.addConfigurationChangeListener(this); diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentTasksController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentTasksController.java index 441f96728d0c..b922cd029468 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentTasksController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentTasksController.java @@ -24,7 +24,6 @@ import static android.view.Display.INVALID_DISPLAY; import static com.android.wm.shell.Flags.enableShellTopTaskTracking; import static com.android.wm.shell.desktopmode.DesktopWallpaperActivity.isWallpaperTask; import static com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_TASK_OBSERVER; -import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_RECENT_TASKS; import android.Manifest; import android.annotation.RequiresPermission; @@ -181,7 +180,7 @@ public class RecentTasksController implements TaskStackListenerCallback, @RequiresPermission(Manifest.permission.SUBSCRIBE_TO_KEYGUARD_LOCKED_STATE) void onInit() { - mShellController.addExternalInterface(KEY_EXTRA_SHELL_RECENT_TASKS, + mShellController.addExternalInterface(IRecentTasks.DESCRIPTOR, this::createExternalInterface, this); mShellCommandHandler.addDumpCallback(this::dump, this); mUserId = ActivityManager.getCurrentUser(); diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java index 6e0e696e15fe..768b14703446 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java @@ -32,7 +32,6 @@ import static com.android.wm.shell.common.split.SplitScreenUtils.isValidToSplit; import static com.android.wm.shell.common.split.SplitScreenUtils.reverseSplitPosition; import static com.android.wm.shell.common.split.SplitScreenUtils.splitFailureMessage; import static com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN; -import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_SPLIT_SCREEN; import static com.android.wm.shell.shared.split.SplitScreenConstants.KEY_EXTRA_WIDGET_INTENT; import static com.android.wm.shell.shared.split.SplitScreenConstants.SPLIT_INDEX_0; import static com.android.wm.shell.shared.split.SplitScreenConstants.SPLIT_INDEX_1; @@ -278,7 +277,7 @@ public class SplitScreenController implements SplitDragPolicy.Starter, mShellCommandHandler.addCommandCallback("splitscreen", mSplitScreenShellCommandHandler, this); mShellController.addKeyguardChangeListener(this); - mShellController.addExternalInterface(KEY_EXTRA_SHELL_SPLIT_SCREEN, + mShellController.addExternalInterface(ISplitScreen.DESCRIPTOR, this::createExternalInterface, this); if (mStageCoordinator == null) { // TODO: Multi-display diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingWindowController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingWindowController.java index 7cb8e8aa7b49..72bad4193f4a 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingWindowController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingWindowController.java @@ -23,8 +23,6 @@ import static android.window.StartingWindowInfo.STARTING_WINDOW_TYPE_SOLID_COLOR import static android.window.StartingWindowInfo.STARTING_WINDOW_TYPE_SPLASH_SCREEN; import static android.window.StartingWindowInfo.STARTING_WINDOW_TYPE_WINDOWLESS; -import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_STARTING_WINDOW; - import android.app.ActivityManager.RunningTaskInfo; import android.app.TaskInfo; import android.content.Context; @@ -119,7 +117,7 @@ public class StartingWindowController implements RemoteCallable<StartingWindowCo private void onInit() { mShellTaskOrganizer.initStartingWindow(this); - mShellController.addExternalInterface(KEY_EXTRA_SHELL_STARTING_WINDOW, + mShellController.addExternalInterface(IStartingWindow.DESCRIPTOR, this::createExternalInterface, this); } diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java index 3f191497e1ed..611f3e0ac5e8 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java @@ -41,7 +41,6 @@ import static android.window.TransitionInfo.FLAG_STARTING_WINDOW_TRANSFER_RECIPI import static com.android.systemui.shared.Flags.returnAnimationFrameworkLongLived; import static com.android.window.flags.Flags.ensureWallpaperInTransitions; import static com.android.window.flags.Flags.migratePredictiveBackTransition; -import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_SHELL_TRANSITIONS; import static com.android.wm.shell.shared.TransitionUtil.isClosingType; import static com.android.wm.shell.shared.TransitionUtil.isOpeningType; @@ -373,7 +372,7 @@ public class Transitions implements RemoteCallable<Transitions>, if (Transitions.ENABLE_SHELL_TRANSITIONS) { mOrganizer.shareTransactionQueue(); } - mShellController.addExternalInterface(KEY_EXTRA_SHELL_SHELL_TRANSITIONS, + mShellController.addExternalInterface(IShellTransitions.DESCRIPTOR, this::createExternalInterface, this); ContentResolver resolver = mContext.getContentResolver(); diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java index c3e396524da1..f22e2a591df3 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java @@ -86,7 +86,6 @@ import com.android.internal.util.test.FakeSettingsProvider; import com.android.wm.shell.RootTaskDisplayAreaOrganizer; import com.android.wm.shell.ShellTestCase; import com.android.wm.shell.TestShellExecutor; -import com.android.wm.shell.shared.ShellSharedConstants; import com.android.wm.shell.sysui.ShellCommandHandler; import com.android.wm.shell.sysui.ShellController; import com.android.wm.shell.sysui.ShellInit; @@ -254,7 +253,7 @@ public class BackAnimationControllerTest extends ShellTestCase { @Test public void instantiateController_addExternalInterface() { verify(mShellController, times(1)).addExternalInterface( - eq(ShellSharedConstants.KEY_EXTRA_SHELL_BACK_ANIMATION), any(), any()); + eq(IBackAnimation.DESCRIPTOR), any(), any()); } @Test diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/onehanded/OneHandedControllerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/onehanded/OneHandedControllerTest.java index 7d063a0a773f..256ed413c2cf 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/onehanded/OneHandedControllerTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/onehanded/OneHandedControllerTest.java @@ -48,7 +48,6 @@ import com.android.wm.shell.common.DisplayController; import com.android.wm.shell.common.DisplayLayout; import com.android.wm.shell.common.ShellExecutor; import com.android.wm.shell.common.TaskStackListenerImpl; -import com.android.wm.shell.shared.ShellSharedConstants; import com.android.wm.shell.sysui.ShellCommandHandler; import com.android.wm.shell.sysui.ShellController; import com.android.wm.shell.sysui.ShellInit; @@ -179,7 +178,7 @@ public class OneHandedControllerTest extends OneHandedTestCase { @Test public void testControllerRegisteresExternalInterface() { verify(mMockShellController, times(1)).addExternalInterface( - eq(ShellSharedConstants.KEY_EXTRA_SHELL_ONE_HANDED), any(), any()); + eq(IOneHanded.DESCRIPTOR), any(), any()); } @Test diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipControllerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipControllerTest.java index b123f4dfac9e..5ef934ce8394 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipControllerTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipControllerTest.java @@ -58,6 +58,7 @@ import com.android.wm.shell.common.DisplayLayout; import com.android.wm.shell.common.ShellExecutor; import com.android.wm.shell.common.TabletopModeController; import com.android.wm.shell.common.TaskStackListenerImpl; +import com.android.wm.shell.common.pip.IPip; import com.android.wm.shell.common.pip.PhonePipKeepClearAlgorithm; import com.android.wm.shell.common.pip.PipAppOpsListener; import com.android.wm.shell.common.pip.PipBoundsAlgorithm; @@ -71,7 +72,6 @@ import com.android.wm.shell.pip.PipParamsChangedForwarder; import com.android.wm.shell.pip.PipTaskOrganizer; import com.android.wm.shell.pip.PipTransitionController; import com.android.wm.shell.pip.PipTransitionState; -import com.android.wm.shell.shared.ShellSharedConstants; import com.android.wm.shell.sysui.ShellCommandHandler; import com.android.wm.shell.sysui.ShellController; import com.android.wm.shell.sysui.ShellInit; @@ -178,7 +178,7 @@ public class PipControllerTest extends ShellTestCase { @Test public void instantiatePipController_registerExternalInterface() { verify(mShellController, times(1)).addExternalInterface( - eq(ShellSharedConstants.KEY_EXTRA_SHELL_PIP), any(), eq(mPipController)); + eq(IPip.DESCRIPTOR), any(), eq(mPipController)); } @Test diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/RecentTasksControllerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/RecentTasksControllerTest.java index 95f371f7000a..c6835b7bde55 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/RecentTasksControllerTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/RecentTasksControllerTest.java @@ -26,8 +26,6 @@ import static com.android.launcher3.Flags.FLAG_ENABLE_REFACTOR_TASK_THUMBNAIL; import static com.android.window.flags.Flags.FLAG_ENABLE_DESKTOP_WINDOWING_PERSISTENCE; import static com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_2_50_50; -import static com.google.common.truth.Truth.assertThat; - import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; @@ -59,7 +57,6 @@ import android.content.pm.PackageManager; import android.graphics.Point; import android.graphics.Rect; import android.os.Bundle; -import android.os.UserManager; import android.platform.test.annotations.DisableFlags; import android.platform.test.annotations.EnableFlags; import android.platform.test.flag.junit.SetFlagsRule; @@ -80,7 +77,6 @@ import com.android.wm.shell.desktopmode.DesktopRepository; import com.android.wm.shell.desktopmode.DesktopUserRepositories; import com.android.wm.shell.desktopmode.DesktopWallpaperActivity; import com.android.wm.shell.shared.GroupedTaskInfo; -import com.android.wm.shell.shared.ShellSharedConstants; import com.android.wm.shell.shared.desktopmode.DesktopModeStatus; import com.android.wm.shell.shared.split.SplitBounds; import com.android.wm.shell.sysui.ShellCommandHandler; @@ -186,7 +182,7 @@ public class RecentTasksControllerTest extends ShellTestCase { @Test public void instantiateController_addExternalInterface() { verify(mShellController, times(1)).addExternalInterface( - eq(ShellSharedConstants.KEY_EXTRA_SHELL_RECENT_TASKS), any(), any()); + eq(IRecentTasks.DESCRIPTOR), any(), any()); } @Test diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/SplitScreenControllerTests.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/SplitScreenControllerTests.java index 72a7a3f5ec99..a6afe0324032 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/SplitScreenControllerTests.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/SplitScreenControllerTests.java @@ -74,7 +74,6 @@ import com.android.wm.shell.common.SyncTransactionQueue; import com.android.wm.shell.desktopmode.DesktopTasksController; import com.android.wm.shell.draganddrop.DragAndDropController; import com.android.wm.shell.recents.RecentTasksController; -import com.android.wm.shell.shared.ShellSharedConstants; import com.android.wm.shell.shared.TransactionPool; import com.android.wm.shell.sysui.ShellCommandHandler; import com.android.wm.shell.sysui.ShellController; @@ -178,7 +177,7 @@ public class SplitScreenControllerTests extends ShellTestCase { when(mDisplayController.getDisplayLayout(anyInt())).thenReturn(new DisplayLayout()); mSplitScreenController.onInit(); verify(mShellController, times(1)).addExternalInterface( - eq(ShellSharedConstants.KEY_EXTRA_SHELL_SPLIT_SCREEN), any(), any()); + eq(ISplitScreen.DESCRIPTOR), any(), any()); } @Test diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/StartingWindowControllerTests.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/StartingWindowControllerTests.java index 7fd1c11e61ae..17a5f5c0f3d4 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/StartingWindowControllerTests.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/StartingWindowControllerTests.java @@ -42,7 +42,6 @@ import com.android.wm.shell.ShellTaskOrganizer; import com.android.wm.shell.ShellTestCase; import com.android.wm.shell.common.DisplayInsetsController; import com.android.wm.shell.common.ShellExecutor; -import com.android.wm.shell.shared.ShellSharedConstants; import com.android.wm.shell.shared.TransactionPool; import com.android.wm.shell.sysui.ShellCommandHandler; import com.android.wm.shell.sysui.ShellController; @@ -99,7 +98,7 @@ public class StartingWindowControllerTests extends ShellTestCase { @Test public void instantiateController_addExternalInterface() { verify(mShellController, times(1)).addExternalInterface( - eq(ShellSharedConstants.KEY_EXTRA_SHELL_STARTING_WINDOW), any(), any()); + eq(IStartingWindow.DESCRIPTOR), any(), any()); } @Test diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/transition/ShellTransitionTests.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/transition/ShellTransitionTests.java index 2442a55d78d0..dd645fd968e4 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/transition/ShellTransitionTests.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/transition/ShellTransitionTests.java @@ -110,7 +110,7 @@ import com.android.wm.shell.common.ShellExecutor; import com.android.wm.shell.recents.IRecentsAnimationRunner; import com.android.wm.shell.recents.RecentTasksController; import com.android.wm.shell.recents.RecentsTransitionHandler; -import com.android.wm.shell.shared.ShellSharedConstants; +import com.android.wm.shell.shared.IShellTransitions; import com.android.wm.shell.shared.TransactionPool; import com.android.wm.shell.sysui.ShellController; import com.android.wm.shell.sysui.ShellInit; @@ -176,7 +176,7 @@ public class ShellTransitionTests extends ShellTestCase { mock(FocusTransitionObserver.class)); shellInit.init(); verify(shellController, times(1)).addExternalInterface( - eq(ShellSharedConstants.KEY_EXTRA_SHELL_SHELL_TRANSITIONS), any(), any()); + eq(IShellTransitions.DESCRIPTOR), any(), any()); } @Test diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/QuickStepContract.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/QuickStepContract.java index ab611901328d..fc536bdb126b 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/QuickStepContract.java +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/QuickStepContract.java @@ -25,9 +25,17 @@ import static com.android.systemui.shared.Flags.shadeAllowBackGesture; import android.annotation.LongDef; import android.content.Context; import android.content.res.Resources; +import android.os.Bundle; +import android.os.IBinder; +import android.os.IInterface; +import android.os.RemoteException; +import android.util.Log; import android.view.ViewConfiguration; import android.view.WindowManagerPolicyConstants; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + import com.android.internal.policy.ScreenDecorationsUtils; import java.lang.annotation.Retention; @@ -39,10 +47,7 @@ import java.util.StringJoiner; */ public class QuickStepContract { - public static final String KEY_EXTRA_SYSUI_PROXY = "extra_sysui_proxy"; - public static final String KEY_EXTRA_UNFOLD_ANIMATION_FORWARDER = "extra_unfold_animation"; - // See ISysuiUnlockAnimationController.aidl - public static final String KEY_EXTRA_UNLOCK_ANIMATION_CONTROLLER = "unlock_animation"; + private static final String TAG = "QuickStepContract"; public static final String NAV_BAR_MODE_3BUTTON_OVERLAY = WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON_OVERLAY; @@ -412,4 +417,20 @@ public class QuickStepContract { public static boolean supportsRoundedCornersOnWindows(Resources resources) { return ScreenDecorationsUtils.supportsRoundedCornersOnWindows(resources); } + + /** + * Adds the provided interface to the bundle using the interface descriptor as the key + */ + public static void addInterface(@Nullable IInterface iInterface, @NonNull Bundle out) { + if (iInterface != null) { + IBinder binder = iInterface.asBinder(); + if (binder != null) { + try { + out.putIBinder(binder.getInterfaceDescriptor(), binder); + } catch (RemoteException e) { + Log.d(TAG, "Invalid interface description " + binder, e); + } + } + } + } } diff --git a/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java b/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java index a5eb92b10239..e3cf41191384 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java +++ b/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java @@ -26,11 +26,6 @@ import static android.view.MotionEvent.ACTION_UP; import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON; import static android.window.BackEvent.EDGE_NONE; -import static com.android.window.flags.Flags.predictiveBackSwipeEdgeNoneApi; -import static com.android.window.flags.Flags.predictiveBackThreeButtonNav; -import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SYSUI_PROXY; -import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_UNFOLD_ANIMATION_FORWARDER; -import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_UNLOCK_ANIMATION_CONTROLLER; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_AWAKE; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_BOUNCER_SHOWING; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_COMMUNAL_HUB_SHOWING; @@ -42,6 +37,9 @@ import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_S import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING_OCCLUDED; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_VOICE_INTERACTION_WINDOW_SHOWING; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_WAKEFULNESS_TRANSITION; +import static com.android.systemui.shared.system.QuickStepContract.addInterface; +import static com.android.window.flags.Flags.predictiveBackSwipeEdgeNoneApi; +import static com.android.window.flags.Flags.predictiveBackThreeButtonNav; import android.annotation.FloatRange; import android.annotation.Nullable; @@ -559,13 +557,9 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis mOverviewProxy = IOverviewProxy.Stub.asInterface(service); Bundle params = new Bundle(); - params.putBinder(KEY_EXTRA_SYSUI_PROXY, mSysUiProxy.asBinder()); - params.putBinder(KEY_EXTRA_UNLOCK_ANIMATION_CONTROLLER, - mSysuiUnlockAnimationController.asBinder()); - mUnfoldTransitionProgressForwarder.ifPresent( - unfoldProgressForwarder -> params.putBinder( - KEY_EXTRA_UNFOLD_ANIMATION_FORWARDER, - unfoldProgressForwarder.asBinder())); + addInterface(mSysUiProxy, params); + addInterface(mSysuiUnlockAnimationController, params); + addInterface(mUnfoldTransitionProgressForwarder.orElse(null), params); // Add all the interfaces exposed by the shell mShellInterface.createExternalInterfaces(params); |