summaryrefslogtreecommitdiff
path: root/core/java/android/window/SplashScreenView.java
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Clear the system bars color when removing the splash screen window." ↵Wei Sheng Shih2022-04-151-71/+2
|\ | | | | | | into tm-dev
| * Clear the system bars color when removing the splash screen window.wilsonshih2022-04-011-71/+2
| | | | | | | | | | | | | | | | | | | | | | | | There can reset the system bars color once the splash screen window is going to be removed, so the real system bars color can be controlled by app, without waiting for the reveal animation. Also clear this effect when transfer splash screen to client, so client can control the color on their own. Bug: 196550450 Test: verify no status bar color changed when playing reveal animation. Change-Id: Ibb353d350fa2921188c8c4b54f8e029ee3869c16
* | Fix splashscreen listener not being calledVadim Caen2022-04-071-2/+4
|/ | | | | | Bug: 228313271 Test: AndroidX SplashscreenParametrizedTest Change-Id: Ia68016ddc73e4d1f5d18f076d4474e0e3086c138
* Merge "Adjust branding image layout if needed." into tm-devWei Sheng Shih2022-03-281-0/+45
|\
| * Adjust branding image layout if needed.wilsonshih2022-03-211-0/+45
| | | | | | | | | | | | | | | | | | THe branding image could overlaps the icon, adjust the layout or hide it according the window size at runtime. Bug: 203366774 Test: modify wm size, verify the branding image won't overlaps on icon. Change-Id: I094c8f2a3f1c8f5fbc87e2234ab2c03daae86c7c
* | Deprecating windowSplashScreenAnimationDuration attr.wilsonshih2022-03-181-15/+10
|/ | | | | | | | | | | | | | | | | | | | | | | In previous CL(5e0c72a2c593de712debf7294e39fb36553a2b30) we provide a way to read the animation duration from AVD and AnimationDrawable, which should be enough to deprecate this attribute since the naming could confusing developers. The attribute was used to cut off the animation if the icon is animatable, but since the animation can be stop when removing the splash screen view from window, the attribute is useless so framework won't read it anymore. The attribute was also be the return value from SplashScreenView#getIconAnimationDuration, however, since this API was designed to let developer decide when to cut off the animation if the app want to handle OnExitAnimationListener#onSplashScreenExit, developer can pre-decide the duration in the app without set this attribute. Bug: 211707095 Test: atest SplashscreenTests StartingSurfaceDrawerTests Change-Id: Ib3a0b4314bd15158c392e56c0e125a33c753e716
* Rename 'EMPTY' to 'SOLID_COLOR' for splash screen style.wilsonshih2022-03-021-4/+4
| | | | | | | | | | Preventing from misleading developers. Bug: 217953215 Test: atest SplashscreenTests StartingSurfaceDrawerTests ActivityRecordTests Change-Id: I8669effb2e843ebe61e807850359b07b36b39fb3
* Estimate animation duration for AVD and AnimationDrawablewilsonshih2022-02-251-4/+7
| | | | | | | | | | | | | | For Android S, we use the API windowSplashScreenAnimationDuration to know the duration of the animatable icon would be, however, developers can be confused to thought that this API is used to declare the duration of splash screen. To get the real duration of the animatable icon, if it is an AVD or AnimationDrawable, try to get the animation duration from it. Test: atest StartingSurfaceDrawerTests SplashscreenTests Bug: 211707095 Change-Id: Ia3f8c5cd50bab164360e07d9ced87ff7f4321e96
* SurfaceView: Synchronize add/remove SurfacePackage with VRI drawVishnu Nair2022-02-091-1/+1
| | | | | | | | | | Apply the SurfacePackage reparent transactions with the next ViewRootImpl draw so the caller can optionally synchronize attaching SurfacePackages with contents on the main window. Test: atest CtsWindowManagerDeviceTestCases:SurfaceControlViewHostTests Bug: 217973491 Change-Id: I87f77cb6a5a2505592f6e9431d2964517fe497cd
* Allow app to receive onSplashscreenExit even for empty splash screen.wilsonshih2022-01-251-4/+16
| | | | | | | | | | Allow developers to customize the exit animation for empty style splash screen, there is a target sdk version check to prevents apps from crash if the app didn't do null pointer check for #getIconView. Bug: 205907456 Test: atest SplashscreenTests Change-Id: I235f25fdf42b7177a6e195d3ffc07b92690e6f79
* Instrument jank of splash screen AVD and exit animationWu Ahan2021-10-251-0/+28
| | | | | | | | Add jank instrument support for splash screen avd and exit animation. Bug: 195736656 Test: see trace in comment Change-Id: I1fdb9e14145bcf519eea99e440de74238e3c765c
* Fixes the flicker when transfer splash screen view to clientwilsonshih2021-10-061-7/+5
| | | | | | | | | | | | | | Use applyTransactionOnDraw to ensure all transaction happen during the same frame, including - hide the starting window. - reparent the remote SurfaceView to client. Bug: 198593932 Test: continues launch test app several times then verify with winscope to ensure there is no flicker anymore. Merged-In: I03c600afdc477ca0c8064b215f2b361468db9f3c Change-Id: I03c600afdc477ca0c8064b215f2b361468db9f3c
* Adding the SurfaceView on splash screen thread.wilsonshih2021-09-071-11/+42
| | | | | | | | | | | | | | | | The SurfaceView of the AVD icon should be create on splash screen thread instead of worker thread, this can guarantee that the first frame of the FrameLayout and AVD will be draw at the same frame. And it also become faster by combining two view in same traversal together. Also stop the AVD animation after splash screen window removed. Bug: 195736516 Test: verify no more Choreographer#doFrame on splash screen thread after splash screen window removed. Change-Id: I5942db8974f1272d9c26ac19b164312e4424be66
* Use SystemUI theme to inflate FrameLayout and SplashScreenViewwilsonshih2021-09-061-4/+5
| | | | | | | | | | | | The FrameLayout and SplashScreenView are only used as container in StartingSurfaceDrawer, so they do not need to be inflated by app's context, which could be affected by app's resources. Bug: 197936273 Test: cold launch test app and show splash screen. Test: launch several apps to verify that everything is fine. Test: atest StartingSurfaceDrawerTests Change-Id: I6de444546b5dfba23fc1d7c9c4deb12787d667c5
* Do not draw icon background if it shouldn't be seenVadim Caen2021-07-231-38/+45
| | | | | | Test: atest CtsWindowManagerDeviceTestCases:SplashscreenTests Bug: 193608336 Change-Id: I824137e67eaa0133337fcaf55c44fca46bac8010
* Implement the legacy splash screen behaviorVadim Caen2021-07-011-1/+18
| | | | | | | | | | | | | | For apps opted out of the new splash screen, we show the full background drawable. Ensure there has send the splash screen background color to StartingWindowListener. Bug: 182880656 Test: manual set useLegacy to true then verify legacy splash screen. Test: atest WmTests:ActivityRecordTests Test: atest StartingSurfaceDrawerTests Change-Id: Icf662f3c5f368f447e718f82f78dc25b909ca9be
* Clear padding and background after create view from context.wilsonshih2021-06-241-0/+1
| | | | | | | | | | | | When create view with Context, there will also load some view attributes from the Context and pre-set to the View object, to ensure the splash screen view not affected by those attributes, clear padding and background after create those view objects. Bug: 191339594 Test: manual launch several apps from Launcher/Notification. Tets: atest SplashscreenTests Change-Id: I05be9c296a04cd49a0896ad8aef57643720d60ce
* Release the SurfacePackageViewHost on splash screen removedVadim Caen2021-06-151-4/+60
| | | | | | | | | | | | | | | | | | | | | | The SurfacePackageViewHost was never release, leading to a leak of its surfaces. This CL ensure it is released: - Directly in the shell if the SplashScreenView was not copied - From the client, through the window manger and then to the shell if the splash screen was copied in the client process Test: Manually tested with app setting by checking if the surfaces are actually removed (winscope + logs) in the following scenarios: - When the application registers an OnExitAnimationListener and calls remove(), - When the application registers an OnExitAnimationListener and dies without calling remove() - When the applicaiton does not register an OnExitAnimationListener and the shell removes the splash screen Bug: 189759180 Change-Id: Ib68bfffad6720911368739d7dd87d8a03034c589
* Always do the app reveal animation when dismissing the splash screenwilsonshih2021-06-111-20/+0
| | | | | | | | | | | Let empty-style splash screen do reveal animation. Also remove the extra animation duration if the icon is empty. Bug: 190695897 Bug: 190695665 Test: manual Test: atest SplashscreenTests Change-Id: I8b3b52369c12fbddc32af8c40f37650cc84a88dd
* Display Splashscreen AVD in a SurfaceViewVadim Caen2021-05-211-23/+150
| | | | | | | | | | If the splashscreen uses an animated icon, we need to display it in a surface view to avoid any jank if the view is passed to the client. Test: CtsWindowManagerDeviceTestCases:SplashscreenTests#testHandleExitIconAnimatingActivity Bug: 181757194 Change-Id: I7e2745a68626849374f5ebb9011c2e8c3b3b92c3
* Drawing the legacy icon similar to the Launcher.wilsonshih2021-05-181-8/+5
| | | | | | | | | The legacy icon on the splash screen should looks similar to it shows on Launcher, a circle background wrap the icon bitmap in the center. Bug: 182883560 Test: atest SplashscreenTests Change-Id: I994f516bb7b5b1231ff9e5bb02a3a92aa5113a84
* Draw splashscreen edge to edgeRiddle Hsu2021-05-141-34/+57
| | | | | | | | | | | | - Switch from PhoneWindow to FrameLayout - Ensure the Action bar is not shown on the splashscree - Do not show the contrast scrim under the system bars - Use the latest insets API to layout fullscreen Test: Updated CtsWindowManagerDeviceTestCases:SplashscreenTests Bug: 181852475 Bug: 184941669 Change-Id: Ifc04bd2227394415cc74c20d2974f4726ec9c789
* Support enable default splash screen reveal aninatmionwilsonshih2021-05-031-0/+20
| | | | | | | | | | | | | | | | | | | | | - Add a temp flag persist.debug.enable_reveal_animation so user can enable reveal animation. - Remove icon shift animation. - For shift up animation, use AnimationAdapter to capture the surface control and pass to Shell, then cancel the animation when WindowState#removeIfPossible for starting window. - Fix the flicker test fail issue caused from shift up animation, the surface control should be release after the last frame was commit. - Use SyncRtSurfaceTransactionApplier to synchronize the shift-up animation, and use vsyncId to ensure the transaction doesn't applyied too early. - Do not play reveal animation for empty splash screen. Test: atest SplashscreenTests StartingSurfaceDrawerTests Bug: 183004107 Bug: 182815506 Bug: 184830058 Change-Id: I4fc8456633b3f4ecd69b168e0222915945210426
* Refine splash screen APIswilsonshih2021-04-011-26/+39
| | | | | | | | | | | | | | | - Add @UiThread on SplashScreenView:remove - Add @UiThread on OnExitAnimationListener:onSplashScreenExit - Add an API SplashScreen#clearOnExitAnimationListener, also update some comment for SplashScreen APIs. - Remove "millis" from getIconAnimationStartMillis and getIconAnimationDurationMillis - Return java.time.Duration for getIconAnimationDuration - Return java.time.Instant for getIconAnimationStart Bug: 182997416 Test: atest SplashscreenTests Change-Id: If07252cc4b554dcde0c5dc4c4dec3f242ee47ae7
* Merge "Hide branding view when empty" into sc-devVadim Caen2021-03-231-3/+3
|\
| * Hide branding view when emptyVadim Caen2021-03-231-3/+3
| | | | | | | | | | | | | | | | It looks like the empty branding view was causing the underlying view to bleed through it so ensuring that it is removed if empty. Bug: 182708883 Change-Id: I868931768bed5b083433fd5222720724bfe3e60e
* | Add trace for tracking the performance of new starting windowwilsonshih2021-03-221-0/+4
| | | | | | | | | | | | | | | | Analysis performance. Bug: 173975965 Test: check perfetto Change-Id: Id0cf1b23799fd8bb0193c950ae4320ccca9dfac0
* | Add API windowSplashScreenIconBackground(12/N)wilsonshih2021-03-191-40/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | Add new API for developer to customize starting window, set a background color behind the icon. Also masking the AVD and icon background like AdaptiveIconDrawable. Ref doc: go/improved_app_launch_animations Bug: 73289295 Test: atest SplashscreenTests Change-Id: Ibba49ecc3ca020022cf775fed302e383908be327
* | Remove the timeout which used for cleanup splash screenwilsonshih2021-03-181-4/+14
|/ | | | | | | | | | | Remove the internal timeout to clean up the starting window, for now on the developers are responsible for removing it. - Also clean up some redundant members. Bug: 181838419 Test: atest SplashscreenTests Change-Id: Iebcccbca454eb7fda4bed637cb5866deec36cf6b
* Implement default exit animation for splash screen.(9/N)wilsonshih2021-03-121-3/+6
| | | | | | | | | | | | | | | | | | | | Implement default exit animation on the view of splash screen, there will be a two layers switch happen when playing exit animation. For the detail please reference go/improved_app_launch_animations and go/app-startup Note: For this version we skip shift-up animation, need to fix the flicker test so we can enable it. Note2: Fix the possible missing splash screen view issue, but could make the first window draw slower, keep tracking. Bug: 73289295 Test: build/flash Test: check splash screen starting window. Test: atest StartingSurfaceDrawerTests ShellTaskOrganizerTests WindowOrganizerTests SplashscreenTests Change-Id: I796811d010ac70f256169dd03d5e05ef0ed79d28
* Add two more Api for SplashScreenView(7/N)wilsonshih2021-02-151-25/+39
| | | | | | | | | | | getIconAnimationDuration - Returns the duration of the icon animation if icon is animatable. getIconAnimationStart - If the replaced icon is animatable, return the animation start time in millisecond based on system. Bug: 73289295 Test: atest CtsWindowManagerDeviceTestCases:SplashscreenTests Change-Id: Ie4332d6764b4d0892a0e5e6f7c297102b71a79f9
* Add API for show branding image on splash screen.(4/N)wilsonshih2021-02-151-33/+105
| | | | | | | | | | | Add API windowSplashScreenBrandingImage to attach branding image on splash screen. Bug: 73289295 Test: build and flash Test: StartingSurfaceDrawerTests SplashscreenTests Change-Id: I15ab799d4e7bb74ce6814fa9375334db18022f3a
* Provide new APIs for customize splash screen window.(3/N)wilsonshih2021-02-151-0/+80
| | | | | | | | | | | | | | | | | | | | | Create new APIs for developer to customize starting window - windowSplashScreenBackground: specify the background color - windowSplashScreenAnimatedIcon: replace center icon on starting window, and it can be animatable. - windowSplashScreenAnimationDuration: the animation duration if the replace icon is animatable, it cannot exceed max_starting_window_intro_icon_anim_duration. Support ADV to replace the icon on starting window. Ref doc: go/improved_app_launch_animations Bug: 73289295 Test: build/flash Test: check splash screen starting window. Test: atest StartingSurfaceDrawerTests SplashscreenTests Test: atest ShellTaskOrganizerTests Change-Id: Id3de3e9b57d769f096baf43713c1e3c327ecfdc8
* Customizable exit splash screen animation.(2/N)wilsonshih2021-02-151-0/+344
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