Loading core/java/android/app/Activity.java +14 −1 Original line number Diff line number Diff line Loading @@ -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); Loading @@ -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*/); Loading core/java/android/app/IActivityTaskManager.aidl +5 −0 Original line number Diff line number Diff line Loading @@ -436,6 +436,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. Loading core/java/android/view/RemoteAnimationDefinition.java +17 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityCompat.java +7 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,13 @@ public class ActivityCompat { mWrapped.registerRemoteAnimations(definition.getWrapped()); } /** * @see Activity#unregisterRemoteAnimations */ public void unregisterRemoteAnimations() { mWrapped.unregisterRemoteAnimations(); } /** * @see android.view.ViewDebug#dumpv2(View, ByteArrayOutputStream) */ Loading services/core/java/com/android/server/wm/ActivityRecord.java +7 −0 Original line number Diff line number Diff line Loading @@ -6060,6 +6060,13 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A void registerRemoteAnimations(RemoteAnimationDefinition definition) { mRemoteAnimationDefinition = definition; if (definition != null) { definition.linkToDeath(this::unregisterRemoteAnimations); } } void unregisterRemoteAnimations() { mRemoteAnimationDefinition = null; } RemoteAnimationDefinition getRemoteAnimationDefinition() { Loading Loading
core/java/android/app/Activity.java +14 −1 Original line number Diff line number Diff line Loading @@ -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); Loading @@ -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*/); Loading
core/java/android/app/IActivityTaskManager.aidl +5 −0 Original line number Diff line number Diff line Loading @@ -436,6 +436,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. Loading
core/java/android/view/RemoteAnimationDefinition.java +17 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading
packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityCompat.java +7 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,13 @@ public class ActivityCompat { mWrapped.registerRemoteAnimations(definition.getWrapped()); } /** * @see Activity#unregisterRemoteAnimations */ public void unregisterRemoteAnimations() { mWrapped.unregisterRemoteAnimations(); } /** * @see android.view.ViewDebug#dumpv2(View, ByteArrayOutputStream) */ Loading
services/core/java/com/android/server/wm/ActivityRecord.java +7 −0 Original line number Diff line number Diff line Loading @@ -6060,6 +6060,13 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A void registerRemoteAnimations(RemoteAnimationDefinition definition) { mRemoteAnimationDefinition = definition; if (definition != null) { definition.linkToDeath(this::unregisterRemoteAnimations); } } void unregisterRemoteAnimations() { mRemoteAnimationDefinition = null; } RemoteAnimationDefinition getRemoteAnimationDefinition() { Loading