Using inteface descriptor as the key for various interface extras
> This makes it easier to backup all the intefaces for testing when the
proxy class needs to be recreated
Bug: 361850561
Test: Presubmit
Flag: EXEMPT refactor
Change-Id: If34611c7d619e729f7f88d095e5744cad5c3dc34
diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java
index 6c4c74c..fd00d0b 100644
--- a/quickstep/src/com/android/quickstep/SystemUiProxy.java
+++ b/quickstep/src/com/android/quickstep/SystemUiProxy.java
@@ -55,6 +55,7 @@
import androidx.annotation.MainThread;
import androidx.annotation.Nullable;
+import androidx.annotation.VisibleForTesting;
import androidx.annotation.WorkerThread;
import com.android.internal.logging.InstanceId;
@@ -70,6 +71,7 @@
import com.android.quickstep.util.unfold.ProxyUnfoldTransitionProvider;
import com.android.systemui.shared.recents.ISystemUiProxy;
import com.android.systemui.shared.recents.model.ThumbnailData;
+import com.android.systemui.shared.system.QuickStepContract;
import com.android.systemui.shared.system.QuickStepContract.SystemUiStateFlags;
import com.android.systemui.shared.system.RecentsAnimationControllerCompat;
import com.android.systemui.shared.system.RecentsAnimationListener;
@@ -1634,4 +1636,24 @@
pw.println("\tmUnfoldAnimationListener=" + mUnfoldAnimationListener);
pw.println("\tmDragAndDrop=" + mDragAndDrop);
}
+
+ /**
+ * Adds all interfaces held by this proxy to the bundle
+ */
+ @VisibleForTesting
+ public void addAllInterfaces(Bundle out) {
+ QuickStepContract.addInterface(mSystemUiProxy, out);
+ QuickStepContract.addInterface(mPip, out);
+ QuickStepContract.addInterface(mBubbles, out);
+ QuickStepContract.addInterface(mSysuiUnlockAnimationController, out);
+ QuickStepContract.addInterface(mSplitScreen, out);
+ QuickStepContract.addInterface(mOneHanded, out);
+ QuickStepContract.addInterface(mShellTransitions, out);
+ QuickStepContract.addInterface(mStartingWindow, out);
+ QuickStepContract.addInterface(mRecentTasks, out);
+ QuickStepContract.addInterface(mBackAnimation, out);
+ QuickStepContract.addInterface(mDesktopMode, out);
+ QuickStepContract.addInterface(mUnfoldAnimation, out);
+ QuickStepContract.addInterface(mDragAndDrop, out);
+ }
}
diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java
index 8edb16f..5135b82 100644
--- a/quickstep/src/com/android/quickstep/TouchInteractionService.java
+++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java
@@ -37,19 +37,6 @@
import static com.android.quickstep.InputConsumerUtils.newConsumer;
import static com.android.quickstep.InputConsumerUtils.tryCreateAssistantInputConsumer;
import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS;
-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.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_BACK_ANIMATION;
-import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_BUBBLES;
-import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_DESKTOP_MODE;
-import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_DRAG_AND_DROP;
-import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_ONE_HANDED;
-import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_PIP;
-import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_RECENT_TASKS;
-import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_SHELL_TRANSITIONS;
-import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_SPLIT_SCREEN;
-import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_STARTING_WINDOW;
import android.app.PendingIntent;
import android.app.Service;
@@ -148,7 +135,6 @@
public class TouchInteractionService extends Service {
private static final String SUBSTRING_PREFIX = "; ";
- private static final String NEWLINE_PREFIX = "\n\t\t\t-> ";
private static final String TAG = "TouchInteractionService";
@@ -173,30 +159,30 @@
@BinderThread
public void onInitialize(Bundle bundle) {
ISystemUiProxy proxy = ISystemUiProxy.Stub.asInterface(
- bundle.getBinder(KEY_EXTRA_SYSUI_PROXY));
- IPip pip = IPip.Stub.asInterface(bundle.getBinder(KEY_EXTRA_SHELL_PIP));
- IBubbles bubbles = IBubbles.Stub.asInterface(bundle.getBinder(KEY_EXTRA_SHELL_BUBBLES));
+ bundle.getBinder(ISystemUiProxy.DESCRIPTOR));
+ IPip pip = IPip.Stub.asInterface(bundle.getBinder(IPip.DESCRIPTOR));
+ IBubbles bubbles = IBubbles.Stub.asInterface(bundle.getBinder(IBubbles.DESCRIPTOR));
ISplitScreen splitscreen = ISplitScreen.Stub.asInterface(bundle.getBinder(
- KEY_EXTRA_SHELL_SPLIT_SCREEN));
+ ISplitScreen.DESCRIPTOR));
IOneHanded onehanded = IOneHanded.Stub.asInterface(
- bundle.getBinder(KEY_EXTRA_SHELL_ONE_HANDED));
+ bundle.getBinder(IOneHanded.DESCRIPTOR));
IShellTransitions shellTransitions = IShellTransitions.Stub.asInterface(
- bundle.getBinder(KEY_EXTRA_SHELL_SHELL_TRANSITIONS));
+ bundle.getBinder(IShellTransitions.DESCRIPTOR));
IStartingWindow startingWindow = IStartingWindow.Stub.asInterface(
- bundle.getBinder(KEY_EXTRA_SHELL_STARTING_WINDOW));
+ bundle.getBinder(IStartingWindow.DESCRIPTOR));
ISysuiUnlockAnimationController launcherUnlockAnimationController =
ISysuiUnlockAnimationController.Stub.asInterface(
- bundle.getBinder(KEY_EXTRA_UNLOCK_ANIMATION_CONTROLLER));
+ bundle.getBinder(ISysuiUnlockAnimationController.DESCRIPTOR));
IRecentTasks recentTasks = IRecentTasks.Stub.asInterface(
- bundle.getBinder(KEY_EXTRA_SHELL_RECENT_TASKS));
+ bundle.getBinder(IRecentTasks.DESCRIPTOR));
IBackAnimation backAnimation = IBackAnimation.Stub.asInterface(
- bundle.getBinder(KEY_EXTRA_SHELL_BACK_ANIMATION));
+ bundle.getBinder(IBackAnimation.DESCRIPTOR));
IDesktopMode desktopMode = IDesktopMode.Stub.asInterface(
- bundle.getBinder(KEY_EXTRA_SHELL_DESKTOP_MODE));
+ bundle.getBinder(IDesktopMode.DESCRIPTOR));
IUnfoldAnimation unfoldTransition = IUnfoldAnimation.Stub.asInterface(
- bundle.getBinder(KEY_EXTRA_UNFOLD_ANIMATION_FORWARDER));
+ bundle.getBinder(IUnfoldAnimation.DESCRIPTOR));
IDragAndDrop dragAndDrop = IDragAndDrop.Stub.asInterface(
- bundle.getBinder(KEY_EXTRA_SHELL_DRAG_AND_DROP));
+ bundle.getBinder(IDragAndDrop.DESCRIPTOR));
MAIN_EXECUTOR.execute(() -> executeForTouchInteractionService(tis -> {
SystemUiProxy.INSTANCE.get(tis).setProxy(proxy, pip,
bubbles, splitscreen, onehanded, shellTransitions, startingWindow,