From 3a1d026bd47665870573358cdd32e5d061ad9d53 Mon Sep 17 00:00:00 2001 From: Riddle Hsu Date: Tue, 2 Feb 2021 18:10:26 +0800 Subject: [PATCH] Restore overridePendingTransition to a sync binder call Otherwise the calling activity is not blocked and can proceed to change activity state, that may cause the override request to be dropped. In addition, it is usually called after startActivity and finish which are non-one-way binder calls. The order also needs to be guaranteed to make the override take effect. Bug: 161781274 Bug: 179008865 Test: WindowUntrustedTouchTest# \ testWhenExitAnimationAboveThresholdFromSameUid_allowsTouch Change-Id: I7ca018a934972c195040f2a9f63a18a59dce9c48 --- core/java/android/app/IActivityClientController.aidl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/java/android/app/IActivityClientController.aidl b/core/java/android/app/IActivityClientController.aidl index c2c62c11b9a6f..9d3286fa271c3 100644 --- a/core/java/android/app/IActivityClientController.aidl +++ b/core/java/android/app/IActivityClientController.aidl @@ -96,7 +96,14 @@ interface IActivityClientController { oneway void setInheritShowWhenLocked(in IBinder token, boolean setInheritShownWhenLocked); oneway void setTurnScreenOn(in IBinder token, boolean turnScreenOn); oneway void reportActivityFullyDrawn(in IBinder token, boolean restoredFromBundle); - oneway void overridePendingTransition(in IBinder token, in String packageName, + /** + * Overrides the animation of activity pending transition. This call is not one-way because + * the method is usually used after startActivity or Activity#finish. If this is non-blocking, + * the calling activity may proceed to complete pause and become stopping state, which will + * cause the request to be ignored. Besides, startActivity and Activity#finish are blocking + * calls, so this method should be the same as them to keep the invocation order. + */ + void overridePendingTransition(in IBinder token, in String packageName, int enterAnim, int exitAnim); int setVrMode(in IBinder token, boolean enabled, in ComponentName packageName);