Loading core/java/android/window/IWindowOrganizerController.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -105,4 +105,7 @@ interface IWindowOrganizerController { /** @return An interface enabling the transition players to report its metrics. */ ITransitionMetricsReporter getTransitionMetricsReporter(); /** @return The transaction queue token used by WM. */ IBinder getApplyToken(); } core/java/android/window/WindowOrganizer.java +21 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.os.IBinder; import android.os.RemoteException; import android.util.Singleton; import android.view.RemoteAnimationAdapter; import android.view.SurfaceControl; /** * Base class for organizing specific types of windows like Tasks and DisplayAreas Loading Loading @@ -184,6 +185,26 @@ public class WindowOrganizer { } } /** * Use WM's transaction-queue instead of Shell's independent one. This is necessary * if WM and Shell need to coordinate transactions (eg. for shell transitions). * @return true if successful, false otherwise. * @hide */ public boolean shareTransactionQueue() { final IBinder wmApplyToken; try { wmApplyToken = getWindowOrganizerController().getApplyToken(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } if (wmApplyToken == null) { return false; } SurfaceControl.Transaction.setDefaultApplyToken(wmApplyToken); return true; } static IWindowOrganizerController getWindowOrganizerController() { return IWindowOrganizerControllerSingleton.get(); } Loading libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java +3 −0 Original line number Diff line number Diff line Loading @@ -175,6 +175,9 @@ public class Transitions implements RemoteCallable<Transitions> { } private void onInit() { if (Transitions.ENABLE_SHELL_TRANSITIONS) { mOrganizer.shareTransactionQueue(); } mShellController.addExternalInterface(KEY_EXTRA_SHELL_SHELL_TRANSITIONS, this::createExternalInterface, this); Loading services/core/java/com/android/server/wm/WindowOrganizerController.java +6 −0 Original line number Diff line number Diff line Loading @@ -1547,6 +1547,12 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub return mTransitionController.mTransitionMetricsReporter; } @Override public IBinder getApplyToken() { enforceTaskPermission("getApplyToken()"); return SurfaceControl.Transaction.getDefaultApplyToken(); } /** Whether the configuration changes are important to report back to an organizer. */ static boolean configurationsAreEqualForOrganizer( Configuration newConfig, @Nullable Configuration oldConfig) { Loading Loading
core/java/android/window/IWindowOrganizerController.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -105,4 +105,7 @@ interface IWindowOrganizerController { /** @return An interface enabling the transition players to report its metrics. */ ITransitionMetricsReporter getTransitionMetricsReporter(); /** @return The transaction queue token used by WM. */ IBinder getApplyToken(); }
core/java/android/window/WindowOrganizer.java +21 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.os.IBinder; import android.os.RemoteException; import android.util.Singleton; import android.view.RemoteAnimationAdapter; import android.view.SurfaceControl; /** * Base class for organizing specific types of windows like Tasks and DisplayAreas Loading Loading @@ -184,6 +185,26 @@ public class WindowOrganizer { } } /** * Use WM's transaction-queue instead of Shell's independent one. This is necessary * if WM and Shell need to coordinate transactions (eg. for shell transitions). * @return true if successful, false otherwise. * @hide */ public boolean shareTransactionQueue() { final IBinder wmApplyToken; try { wmApplyToken = getWindowOrganizerController().getApplyToken(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } if (wmApplyToken == null) { return false; } SurfaceControl.Transaction.setDefaultApplyToken(wmApplyToken); return true; } static IWindowOrganizerController getWindowOrganizerController() { return IWindowOrganizerControllerSingleton.get(); } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java +3 −0 Original line number Diff line number Diff line Loading @@ -175,6 +175,9 @@ public class Transitions implements RemoteCallable<Transitions> { } private void onInit() { if (Transitions.ENABLE_SHELL_TRANSITIONS) { mOrganizer.shareTransactionQueue(); } mShellController.addExternalInterface(KEY_EXTRA_SHELL_SHELL_TRANSITIONS, this::createExternalInterface, this); Loading
services/core/java/com/android/server/wm/WindowOrganizerController.java +6 −0 Original line number Diff line number Diff line Loading @@ -1547,6 +1547,12 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub return mTransitionController.mTransitionMetricsReporter; } @Override public IBinder getApplyToken() { enforceTaskPermission("getApplyToken()"); return SurfaceControl.Transaction.getDefaultApplyToken(); } /** Whether the configuration changes are important to report back to an organizer. */ static boolean configurationsAreEqualForOrganizer( Configuration newConfig, @Nullable Configuration oldConfig) { Loading