diff options
| author | wilsonshih <wilsonshih@google.com> | 2020-12-01 15:07:17 +0800 |
|---|---|---|
| committer | Vadim Caen <caen@google.com> | 2021-02-15 14:49:00 +0100 |
| commit | 56f65c3bb7d52422dc33108268207954d34633cb (patch) | |
| tree | 150ac133282c442136908890cf11ee752a2b4550 /core/java/android/app/ActivityTaskManager.java | |
| parent | d8385e060c12acc21010956f4fbe57daa526a41a (diff) | |
Customizable exit splash screen animation.(2/N)
Introduce new APIs to customize exit splash screen animation.
- SplashScreen
This can be used for Activity to handle the exit splash screen
animation.
- SplashScreen#OnExitAnimationListener
When receive onSplashScreenExit, the splash screen view will be on
top of the activity.
- SplashScreenView
The view object which represents the view of current starting window.
There are two APIs for developer to control it:
- getIconView: get the icon view object.
- remove: remove the view and release resources.
If an Activity create a OnExitAnimationListener and set on
SplashScreen, the core will request a copy of SplashScreenView
from Shell, then send the parcelable information to client to
reconstruct the view on top of the DecorView, then call
onSplashScreenExit to let the listener able to operating this view.
Bug: 73289295
Test: build/flash, check splash screen starting window.
Test: atest StartingSurfaceDrawerTests ActivityRecordTests
WindowOrganizerTests
Test: atest CtsWindowManagerDeviceTestCases:SplashscreenTests
Change-Id: I9f77fb4471bcf37a7f74d6c18a345ca56c05b716
Diffstat (limited to 'core/java/android/app/ActivityTaskManager.java')
| -rw-r--r-- | core/java/android/app/ActivityTaskManager.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/core/java/android/app/ActivityTaskManager.java b/core/java/android/app/ActivityTaskManager.java index 70fa4445479b..233f737b8e0f 100644 --- a/core/java/android/app/ActivityTaskManager.java +++ b/core/java/android/app/ActivityTaskManager.java @@ -19,6 +19,7 @@ package android.app; import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY; import android.annotation.NonNull; +import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.SystemService; import android.annotation.TestApi; @@ -37,6 +38,7 @@ import android.os.ServiceManager; import android.util.DisplayMetrics; import android.util.Singleton; import android.view.RemoteAnimationDefinition; +import android.window.SplashScreenView.SplashScreenViewParcelable; import java.util.List; @@ -243,6 +245,22 @@ public class ActivityTaskManager { } /** + * Notify the server that splash screen of the given task has been copied" + * + * @param taskId Id of task to handle the material to reconstruct the splash screen view. + * @param parcelable Used to reconstruct the view, null means the surface is un-copyable. + * @hide + */ + public void onSplashScreenViewCopyFinished(int taskId, + @Nullable SplashScreenViewParcelable parcelable) { + try { + getService().onSplashScreenViewCopyFinished(taskId, parcelable); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + + /** * Return the default limit on the number of recents that an app can make. * @hide */ |
