diff options
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/app/Activity.java | 15 | ||||
| -rw-r--r-- | core/java/android/app/IActivityTaskManager.aidl | 5 | ||||
| -rw-r--r-- | core/java/android/view/RemoteAnimationDefinition.java | 17 |
3 files changed, 36 insertions, 1 deletions
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index ff581c059935..9e0c2fc18fd9 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -8674,7 +8674,6 @@ public class Activity extends ContextThemeWrapper * @hide */ @RequiresPermission(CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS) - @UnsupportedAppUsage public void registerRemoteAnimations(RemoteAnimationDefinition definition) { try { ActivityTaskManager.getService().registerRemoteAnimations(mToken, definition); @@ -8683,6 +8682,20 @@ public class Activity extends ContextThemeWrapper } } + /** + * Unregisters all remote animations for this activity. + * + * @hide + */ + @RequiresPermission(CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS) + public void unregisterRemoteAnimations() { + try { + ActivityTaskManager.getService().unregisterRemoteAnimations(mToken); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + class HostCallbacks extends FragmentHostCallback<Activity> { public HostCallbacks() { super(Activity.this /*activity*/); diff --git a/core/java/android/app/IActivityTaskManager.aidl b/core/java/android/app/IActivityTaskManager.aidl index e2b1b8664d75..df5d6c71756d 100644 --- a/core/java/android/app/IActivityTaskManager.aidl +++ b/core/java/android/app/IActivityTaskManager.aidl @@ -437,6 +437,11 @@ interface IActivityTaskManager { void registerRemoteAnimations(in IBinder token, in RemoteAnimationDefinition definition); /** + * Unregisters all remote animations for a specific activity. + */ + void unregisterRemoteAnimations(in IBinder token); + + /** * Registers a remote animation to be run for all activity starts from a certain package during * a short predefined amount of time. */ diff --git a/core/java/android/view/RemoteAnimationDefinition.java b/core/java/android/view/RemoteAnimationDefinition.java index c9bd92ae84ba..5a8ac544e27e 100644 --- a/core/java/android/view/RemoteAnimationDefinition.java +++ b/core/java/android/view/RemoteAnimationDefinition.java @@ -22,9 +22,12 @@ import android.annotation.Nullable; import android.app.WindowConfiguration; import android.app.WindowConfiguration.ActivityType; import android.compat.annotation.UnsupportedAppUsage; +import android.os.IBinder; import android.os.Parcel; import android.os.Parcelable; +import android.os.RemoteException; import android.util.ArraySet; +import android.util.Slog; import android.util.SparseArray; import android.view.WindowManager.TransitionType; @@ -124,6 +127,20 @@ public class RemoteAnimationDefinition implements Parcelable { } } + /** + * Links the death of the runner to the provided death recipient. + */ + public void linkToDeath(IBinder.DeathRecipient deathRecipient) { + try { + for (int i = 0; i < mTransitionAnimationMap.size(); i++) { + mTransitionAnimationMap.valueAt(i).adapter.getRunner().asBinder() + .linkToDeath(deathRecipient, 0 /* flags */); + } + } catch (RemoteException e) { + Slog.e("RemoteAnimationDefinition", "Failed to link to death recipient"); + } + } + @Override public int describeContents() { return 0; |
