summaryrefslogtreecommitdiff
path: root/core/java/android/window/StartingWindowInfo.java
Commit message (Collapse)AuthorAgeFilesLines
* Fix splashscreen listener not being calledVadim Caen2022-04-071-1/+5
| | | | | | Bug: 228313271 Test: AndroidX SplashscreenParametrizedTest Change-Id: Ia68016ddc73e4d1f5d18f076d4474e0e3086c138
* Rename 'EMPTY' to 'SOLID_COLOR' for splash screen style.wilsonshih2022-03-021-11/+11
| | | | | | | | | | Preventing from misleading developers. Bug: 217953215 Test: atest SplashscreenTests StartingSurfaceDrawerTests ActivityRecordTests Change-Id: I8669effb2e843ebe61e807850359b07b36b39fb3
* Allow app to receive onSplashscreenExit even for empty splash screen.wilsonshih2022-01-251-0/+13
| | | | | | | | | | 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
* Merge "Draw splash window during app switch if the top activity is not drawn."Josh Yang2021-10-141-0/+5
|\
| * Draw splash window during app switch if the top activity is not drawn.Josh Yang2021-10-081-0/+5
| | | | | | | | | | | | | | | | | | | | | | In Wear OS, when the device enters ambient mode, we will switch the front activity to the background. When device exits ambient mode, the previous activity will be moved back to the front. If the activity hasn't been drawn yet when the device enters ambient mode, we want to show the splash window when it's brought back to the front. Bug: 176837715 Bug: 199552234 Fix: 199552234 Test: manual test Change-Id: I8275db9cb51575b61f5a4f04316b77e3f53ba220 (cherry picked from commit 3dc923bafc4454490935fd9e6b4b6602a91febaf)
* | Fix snapshot starting window stuck if the task never gain focuswilsonshih2021-10-051-2/+0
|/ | | | | | | | | | | | | | | | | | | | | | | | | | The tasksnapshot starting window could stuck on task if the task never gain focus, this could happen when launch multiple tasks to front, e.g. split screen, or add snapshot starting window to a pip task. As using task focus to judge the task snapshot removal may error-prone. (i.e. unexpected window focus in/lost, non-focusable task window..) To ensure the tasksnapshot removal works stable, extanding MAX_DELAY_REMOVAL_TIME_IME_VISIBLE timeout from 450ms to 600ms and also reference mayImeShowOnLaunchingActivity to know whether IME showing on this activity. Bug: 199377815 Bug: 201264769 Bug: 200778734 Test: atest ActivityRecordTests StartingSurfaceDrawerTests SplashscreenTests Test: manual launch apps with IME from Recents. Test: enter pip, power on/off, verify starting window is removed. Test: manual enter split screen, verify starting window is removed. Change-Id: I81b048a655124923a5f19e7f236511502bbf4c91 (cherry picked from commit a4f760bee7d86d8d68d155dc256f984f1b3d7478)
* Make requested visibility available in snapshot starting windowYunfan Chen2021-09-151-3/+12
| | | | | | | | | | | | This change make the snapshot starting window holds the requested visibilities when created from the task. Such that, when the window get back from the background, the insets state in the window state can have the correct visibilities. Test: check getInsetsStateWithVisibilityOverride as described in the bug. Bug: 196637509 Bug: 185729224 Change-Id: I54ab0791b169331c22cd89f7e6da640322bf7dd3
* Correcting the package name used on splash screen window.wilsonshih2021-07-231-0/+12
| | | | | | | | | | | | The top activity in TaskActivitiesReport can be filter out if the state of top activity is INITIALIZING, this doesn't make sense for splash screen, because the state of the top activity do can be INITIALIZING. Create a filed targetActivityInfo in StartingWindowInfo to specify the starting activity info. Bug: 193459277 Test: atest SplashscreenTests StartingSurfaceDrawerTests Change-Id: Ifec7aff644013a0426e0622162ab24f6b9fb3d8f
* Implement the legacy splash screen behaviorVadim Caen2021-07-011-2/+12
| | | | | | | | | | | | | | 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
* Tracking launch activity to decide next splash screen style.wilsonshih2021-05-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The generic rule to showing an empty splash screen is that if an activity is launched from another visible activity besides Launcher. So with this rule, when prepare the starting window for a launching activity, we can tracking where the source activity comes from and whether it has show splash screen or has drawn window before. This can solve the inconsistent launch sequence when launching an activity from non-system surface for the status either new task or new process. There will show an empty style splash screen if the launching activity was drawn or it has show splash screen before. Another coner case is that a process could start a new activity from service, for the better UX we should also check whether there any existing activities which were from the same process or same package and has already at foreground. We can still add "show icon_style_splash_screen" flag in the future. Bug: 185433040 Bug: 185567723 Bug: 185448781 Test: atest SplashscreenTests ActivityRecordTests Test: manual test Launch browser from -1, empty splash screen Launch calendar from launcher, icon splash screen Launch work app from Settings -> Notifications -> Calendar show empty splash screen Launch Settings -> System update show empty splash screen Launch Dialer -> call out -> show empty splash screen on InCallActivity Change-Id: Id84f1f69de6c5e3f1c21cd249c62404958410193
* Starting window performance tuning for binder block.wilsonshih2021-04-161-0/+8
| | | | | | | | | | | | | | | | | | | | | | | - Pass TaskSnapshot to Shell directly. - Parallel process: create a splash screen worker thread to create the splash screen view and pre-draw the icon drawable, and use splash screen thread to do stuff about window's lifecycle like add/remove window. We don't use shell main thread here so the starting window won't blocking any task execute on main thread. - Trigger addStartingWindow directly when startActivity, also removeStartingWindow directly without post the animation thread. - Do not defer addStartingWindow for prepare surface, on the contrast it should be execute before prepare surface. - Remove ActivityRecordTests#testAddRemoveRace, it wasn't been test as expected because in original logic the add and remove starting window are post to animation thread, so the test was actually testing on handler#postAtFrontOfQueue and handler#removeCallbacks. For now it will only cause OutOfMemoryError. Bug: 183665220 Bug: 182836977 Test: atest StartingSurfaceDrawerTests SplashscreenTests Change-Id: Ie9a529c7d81f07f923394eb69944518f3e9010ce
* Use a blank splash screen for new task activitywilsonshih2021-04-011-2/+12
| | | | | | | | | | | Add a condition when launch activity from continuous package, consider to show a blank splash screen since the activity might start from an existing task, showing an icon on it might seems strange to user. Bug: 183150443 Bug: 183108088 Test: atest StartingSurfaceDrawerTests ActivityRecordTests Change-Id: Ia76648c291d602302725a1814991971a1d544549
* Fix several test failures for the new starting window.(10/N)wilsonshih2021-03-121-0/+8
| | | | | | | | | | | | | | | | | 1. Register TestStartingWindowOrganizer to mock add/remove starting window. 2. Do not show starting window if not occluded. 3. Add ReadFrameBuffer permission so Car can get TaskSnapshot. 4. Correct package path for shell.startingsurface. 5. Do not show starting window for home type. Bug: 73289295 Bug: 131311659 Test: atest TaplTestsLauncher3 Test: atest WmTests StartingSurfaceDrawerTests TaskSnapshotWindowTest Test: atest CtsWindowManagerDeviceTestCases Change-Id: I89930d2e8a05cca6197c36c780ee1843fe454354
* Extract StartingSurface interface on WMShellBaseModule(7/N)wilsonshih2021-02-261-0/+25
| | | | | | | | | | | Decouple the dependency for the rest CLs. Bug: 73289295 Bug: 131311659 Test: atest WindowOrganizerTests StartingSurfaceDrawerTests SplashscreenTests Change-Id: Ifd323714184fad285b4d65f8c86c9b8feafc2374
* Allow ShortcutInfo to specify a theme for splash screen.(5/N)wilsonshih2021-02-151-1/+10
| | | | | | | | | | | | | | | Provides new APIs so that shortcuts can preset the theme of the splash screen window. - Static way: android:splashScreenTheme Preset the splash screen theme from xml. - Dynamic way: ShortcutInfo.Builder#setStartingTheme Preset the splash screen theme when construct the ShortcutInfo programmatically. Bug: 73289295 Test: build/flash Test: atest AppWindowTokenTests ActivityRecordTests Change-Id: Ie5e73f9b22fea22659e496c12198c942f4bc93cd
* Mirror TaskSnapshotSurface to WMShell(2/N)wilsonshih2020-12-171-0/+150
- Let WMShell able to draw task snapshot surface. - Create new class StartingWindowInfo to pass needed data from WM to Shell. - Rename TaskSnapshotSurface -> TaskSnapshotWindow in WMShell. - Mirror and modify a new TaskSnapshotWindowTest in WMShell. Bug: 131727939 Test: atest WindowOrganizerTests ActivityRecordTests TaskSnapshotWindowTest StartingSurfaceDrawerTests Test: build and flash, check shell able to show/remove TaskSnapshotWindow Change-Id: I70dec8ce2bf1ed7d876657324e51357690c8b396