From b7fe2d63f3746929215d9016ea6c811daee24723 Mon Sep 17 00:00:00 2001 From: Evan Rosky Date: Tue, 16 Aug 2022 20:40:18 +0000 Subject: [PATCH] Provide access to Shell's apply token This enables other processes (launcher) to share the token so that the order of Transaction.apply() matches the order that surfaceflinger actually applies them. Bug: 242193885 Test: quick-switch between apps repeatedly. Change-Id: Id34e1ba8b59e0c82201d96ca65e430ce9696fd19 --- .../com/android/wm/shell/transition/IShellTransitions.aidl | 5 +++++ .../src/com/android/wm/shell/transition/Transitions.java | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/IShellTransitions.aidl b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/IShellTransitions.aidl index bdcdb63d2cd61..cc4d268a0000a 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/IShellTransitions.aidl +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/IShellTransitions.aidl @@ -34,4 +34,9 @@ interface IShellTransitions { * Unregisters a remote transition handler. */ oneway void unregisterRemote(in RemoteTransition remoteTransition) = 2; + + /** + * Retrieves the apply-token used by transactions in Shell + */ + IBinder getShellApplyToken() = 3; } 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 9335438cea508..f74452c2924fd 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 @@ -952,6 +952,11 @@ public class Transitions implements RemoteCallable { transitions.mRemoteTransitionHandler.removeFiltered(remoteTransition); }); } + + @Override + public IBinder getShellApplyToken() { + return SurfaceControl.Transaction.getDefaultApplyToken(); + } } private class SettingsObserver extends ContentObserver {