SystemUI does not need to re-calculate background color of starting
window because Shell library is bound to SystemUI, so status bar can
get background color directly, also this can support to get the
background color from snapshot starting window.
Also fix the starting window listener did not receiveing background
color successful because makeSplashScreenContentView is execute on
another background thread, so there should block the splash screen
thread until the background color is estimated.
Bug: 192213918
Bug: 192659309
Test: manual launch apps from Notification and Launcher, ensure the
color is correctly send to SystemUI or Launcher.
Change-Id: I626cb23d7aebfe4e032fad285bfad374c0e11cea
Previously, we tried to tuning boottime of SysUI
See go/systemuiboottiming_ohm
- Reduce access setting provide at SysUI start-up
- Remove unused obervers
1. Timeout
2. TapAppExit
- Update mShortcutEnabled state at ctor
Test: manual enable OHM shortcut, rebot
make sure shortcut function works
Test: atest WMShellUnitTests
Test: asit/perf/boottime_test
Bug: 193225130
Change-Id: I2753f8b1e47622c00b9c6d2f4cd319c6e43634ea
- Always show tutorial for user to know device state
is in One-handed mode.
- Clean the redundant params from ctor
Test: manual trigger OHM
Test: atest WMShellUnitTests
Bug: 192648901
Change-Id: I10c3f3f29190b672fb88471df3cf374a994cdaa7
This reverts commit 76370b6fe6.
Reason for revert: Fix the merge break in ShellTaskOrganizerTests.java
Fix: 193069342
Test: atest WMShellUnitTests:ShellTaskOrganizerTests
Change-Id: I02c4bddc407eaac0ebb7cd5abb0b394f242d4d6e
Fix race condition in SystemUIBootTiming issue.
1. Avoid updateOneHandedEnabled() called twice during init
a. [O] come from setOneHandedEnabled()
b. [X] come from setSwipeToNotificationEnabled()
2. Passively waiting shortcut enabled changed callback, and then
query setting ACCESSIBILITY_BUTTON_TARGETS status.
3. Add a new flag isShortcutEnabled to cache shortcut enabled
state.
4. By new OHM Settings UX design setSwipeToNotificationEnabled()
should NOT setEnabledGesturalOverlay().
5. Remove redundant auto enabled Toast and print in log instead.
(In general case, user is not able to see the Toast)
Test: atest google/perf/boottime/boottime-test
Test: atest SystemUITests
Test: atest WMShellTests
Test: manual factory reboot, OHM should disabled by default
Bug: 192612924
Change-Id: I8b24c99bc8bd5bfb17c73a6bb8494109d9a8170d
Security report shows that this can cause leak token of different app.
Replace the functionality with a callback to the TaskOrganizerController
to restart activity when size compat restart button is clicked.
Bug: 186776724
Test: manually verify the restart button still works
Change-Id: I097b9f02e8435e6765695b9d5a531a4e165bac66
Merged-In: I097b9f02e8435e6765695b9d5a531a4e165bac66
Before, when a size compat task was hidden, the size compat UI might
still be showing. Now, remove the UI when the task is no longer visible.
Bug: 193069342
Test: manually verify the size compat button is not showing in recents
Change-Id: Ia17a97f5e7a9af497d8da16b31bb5169dd502d53
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
The normal bounds may be too small to fit all menu
icons, so before expanding to the normal bounds,
first check that the expected menu size will fit and
if not adjust the bounds so that it will.
Bug: 191296663
Test: atest PipBoundsAlgorithmTest
manual - verify vertical YT video fits all three actions
Change-Id: I531d86501927a6a3ffeb069193c592366ef8f584
When device (factory)boot, controller regsiter settings
'one_handed_mode_activated' will receive callback, and
the shortcut do not enabled by default, the flow will
go to auto enable one-handed mode feature and leading
unexpedted UX(disabled by default) and testing issue.
Solution:
- Add additional check for shortcut enabled when
onActivatedActionChanged() callback.
- When setting is pull screen, notify shortcut
one_handed_mode_activated to reset and align current
mState when function enabled.
Note:
The setting provider one_handed_mode_activated could set
2 different values when shortcut button pressed
- "0" mapping to pull screen STATE_NONE
- "1" mapping to pull screen STATE_ACTIVE
Since show notification do not have state, whenever
onChange callback, we trigger expand notification.
Test: atest WMShellUnitTests
Test: manual factory reset | reboot check Log should show \
"Shortcut not enabled, skip onActivatedActionChanged()".
Test: manual disable both OHM & shortcut toggle in settings \
'# adb shell settings --user 0 put secure \
one_handed_mode_activated 1'
should not auto enable OHM main toggle.
Bug: 191736174
Bug: 191831415
Bug: 191950195
Fixes: 191812697
Change-Id: Ib9d66fbbcc7e6a52a37bb47efebf90c9d2644508
As CL[1] removed the delay time to remove starting window in shell,
even the benifits is to make good touch responsiness when launched the
activity, but may easier cause flickering since removing the starting
window when the activity allDrawn doesn't means the UI are all set.
(like some apps might needs adjust the surface frame or even IME
needs more time wait for animation finish, if the snapshot window
has these previews).
In case flickering happens when the Shell removes the task snapshot
window too quickly, partially reverts CL[1] delay removal logic
in TaskSnapshotWindow#remove, and use TaskSnapshot#hasImeSurface
to set a proper delay removal time:
- General (no IME visible): 100ms
- IME visible: 350ms
[1]: I5fb0fa3a1e6a5e6210d3baf400a84c5892bd2e34
Fix: 189825624
Test: manual switch tasks with/without ime window, also test
with some market input methods.
Change-Id: I7865e17b57961e12a0cdcf068e412195123a6ec7
In previous design, we only get the display bounds once when the first
time the hide cutout is enabled. But if user selects "Hide" first and
then switch to "Render apps below cutout area", the display bounds we
get will be incorrect.
Add a listener to monitor and update the display size.
Bug: 191273507
Test: atest HideDisplayCutoutTest
Test: manual - 1. select "Hide"
2. select "Render apps below cutout area"
3. observe the result
Change-Id: I0ff1c4b822615d6bd43adb2e9e9d17d6bd9b91a8
When Device boot and SystemUI servies starting, settings provider
may callback onChange() when OneHandedController register observer.
If the callback timing earlier han mEventCallback registered by
WMShll#initOneHanded, then the NPE will happen.
The simple fix is to add NPE check in
OneHandedController#notifyExpandNotifcation()
we can just ignore the callback during init time since the singal
is to expand notification and come from shorcut after user enable
and tap shortcut.(No need to act for the signal during boot progress.)
Test: manual reboot device and observe
Test: atest WMShellUnitTests
Bug: 191600033
Change-Id: I73849afa9904031759da304298221dbb222aeaaa
1) Add OneHandedEventCallback for WMShell to register
callback, and if one handed mode settings set show
notifications, when user tap one handed mode shortcut
notify WMShell send KEYCODE_SYSTEM_NAVIGATION_DOWN
through OneHandedEventCallback with SysUIMainExecutor.
2) Add isReady() flag in OneHandedDisplayAreaOrganizer
and Simplify the flow of onActivatedActionChanged()
to prevent potential race problem while auto-enable
One-handed and immeditately startOneHanded(), however,
DisplayAreaOrganizer#onDisplayAreaAppeared() may not
ready for transtion yet, and result mState keep in
unfinsihed STATE_ENTERING.
3) Adjust the transiton duration from 800ms to 600ms
800ms is a little bit long to affect timing of
apply runtime overlay package.
4) DelayExecute setEnabledGesturalOverlay() until
transition finised and at most delay once.
- onSwipeToNotificationEnabledChanged() : DelayExecute
- onEnabledSettingChanged() : DelayExecute
- Ctor setupGesturalOverlay() : No DelayExecute
- mState.isTransitioning() : DelayExecute
Test: WMShellUnitTests
Bug: 182425480
Change-Id: I2615c3b30ad95a858510b4bcc73d8f343843fc96
The background color of splash screen starting window may depend
on the declared window background and the content if icon. That
may be expensive operations if the drawables are not using pure
color. Because the attributes to compute the colors are simple,
it only need a few fields to identify whether the incoming request
has been computed. So it is worth to cache them with very small
extra memory. The cache of a package will be cleared if the package
is removed or replaced.
It may save the creation time up to 20ms (depends on the complexity
of the drawable).
Bug: 190176296
Test: atest StartingSurfaceDrawerTests#testColorCache
Test: Cold/warm launch app twice and compare the duration of
trace name "makeSplashScreenContentView". The second time
should be faster. Re-install the app and launch again,
the trace will contain "peekWindowBGColor" that means
that cache for the package was cleared.
Change-Id: I61158416694a226999843fa8fc6a8b23d6893f02
* adjust the default spacing so that its small enough that 5 bubbles
can show on crosshatch (5 is the default)
* Add max bubbles to BubblePositioner, replace the other usages
Test: atest BubbleDataTest
Test: manual - have 5 bubbles
- adjust screen size to largest
- open the stack
=> notice that the number of bubbles have changed and
they all fit on the screen without overlap
- repeat & check the different densities
Bug: 187715444
Change-Id: I4794ed89541eeb573c367748f980cf7ffe45d3f3
* Add shadows back -- icon lib is no longer adding shadows but
bubbles should still have them for background protection.
* The shadow is active on all bubbles when:
- the stack is being dragged around & bubbles trail behind it
- the stack is expanded (the bubbles can be dragged to dismiss &
can show on top of the expanded view or overflow)
* When the stack is resting, only the top two bubbles show a shadow
& the bubbles below that animate their Z translation so the change
is smooth.
* Also put the # of bubbles we show in the stack in a static int &
updated usages
Test: visual - add 5 of the 'test bubbles' from the test app
and notice the white backgrounds don't blend together
due to the shadow & that they are distinct when
placed on a white background
- drag / fling the stack around & notice shadows show
for all the bubbles while moving but once they come
to rest you don't see a stack of shadows
Bug: 183657577
Change-Id: I0c273f4d0261db9eac1b49ef584fd62fbb67cc9a
TaskSurfaceHelper(Controller) will be used as an interface to communicate
with the SurfaceControl of the underlying Task. This change adds a function
to set the game mode metadata for the task layer.
Bug: 186025682
Test: atest TaskSurfaceControllerTest
Change-Id: I136b65636b98e1883eaf9e4f4f0b34c61350d4e4
* Update sizes of badge & bubble; also simplify some of the sizing
code, we can do it with just the overall size
* Simplified things, instead of the inner / outer sizes just use
the overall size
Test: visual - create a bubble and look at the size of the bubble and
badge
visual - have some bubbles, change display size, create a new
bubble & verify that all of the sizes are the same
Bug: 183657577
Change-Id: Ibd8609a8737bb0a57519fa70fba17138bb69b379
Test: manual - add more than 2 bubbles, note you only see the top 2
- expand & collapse the stack, note you only see top 2
after collapse
- fling the stack around, note once it hits the edge
you only see top 2 bubbles but while dragging around
you see all of them following
Bug: 180142824
Change-Id: I168a14e1fba1506f53ed0734b55b44971d128de4
The flicker test suite grew and now trigger a treehuger SLO violation. To address this problem create different groups for different tests using: --module-arg <TEST SUITE>:include-annotation:<GROUP>
Where:
<TEST SUITE> = FlickerTests or WMShellFlickerTests
<GROUP> = com.android.server.wm.flicker.annotation.Group1 or com.android.server.wm.flicker.annotation.Group2 or com.android.server.wm.flicker.annotation.Group3
For example:
1) to run only tests in the first group in flicker use: `--module-arg FlickerTests:include-annotation:com.android.server.wm.flicker.annotation.Group1`
2) to run only the third group of tests from wmshell flicker: ``--module-arg FlickerTests:include-annotation:com.android.server.wm.flicker.annotation.Group3`
Bug: 180620475
Test: atest FlickerTests WMShellFlickerTests with the respective parameters
Change-Id: I82f668713ba262bafe2758e2c618bfc060cc2c8a
* Allow bounds to be set on launch params for multiwindow activities
* Users of TaskView should pass bounds when starting an activity
otherwise they will see this animation
* Modify bubbles & controls to pass launch bounds
Test: atest TaskLaunchParamsModifierTests LaunchParamsControllerTests
MultiWindowTests
Bug: 182299605
Bug: 182516248
Change-Id: Ie5337593d776309f8aac0c6991cf846463e519a7
Tasksnapshot window can block touch event so user may not able
to touch the screen after showing task snapshot. Remove the delay
so app window can response touch event as soon as possible.
Bug: 187227846
Test: atest TaskSnapshotWindowTest
Change-Id: I5fb0fa3a1e6a5e6210d3baf400a84c5892bd2e34
The splashscreenview can be replaced if starting window was transferred
and the first starting window didn't added success.
There should verify the appToken before setViewSynchronized set the
splashscreenview back to the container.
Issue sequence:
- Start first activity A, core request to add a starting window for it.
- Start second activity B, core try to transfer starting window from A
to B but since the window haven't added back, there will trigger to
add a new starting window for B.
- SystemUI add starting window to A but added fail because there was
transferred.
- SystemUI add starting window to B, success.
- Choreographer post setViewSynchronized to add view for A and B to the
container, because we only verify by taskId, so the SplashscreenView was
overwrite by A.
- After reveal animation finish, SplashScreenView#post will not be
executed because this view was not on screen.
Fixes: 188540606
Test: atest StartingSurfaceDrawerTests
Test: Open twitter from notification.
Change-Id: I894da75827556d3c1bc8bb0656196102de5a6847
When a Task is detached but is still stored as a recent Task, it should
be allowed to launched into split screen.
Bug: 176061101
Test: atest WMShellFlickerTests:EnterSplitScreenFromDetachedRecentTask
Test: atest WmTests:RecentTasksTest
Change-Id: Ic72901ca76f4acb6e68926062675ecc290b399be
* changes:
Adjust split layout with IME animation in split (5/N)
Adjust split layout with IME animation in split (4/N)
Adjust split layout with IME animation in split (3/N)
Adjust split layout with IME animation in split (2/N)
Adjust split layout with IME animation in split (1/N)
Previously if user do not trigger OHM, target view was attached
to window and setVisbility INVISIBLE.
Refactor to improve memory & perforamcne for systemui, and align
the state changes of one handed controller
1) Bind OneHandedController OneHandedState to handle target view
attach and remove from window.
2) Do NOT create view and attach to window until STATE_ENTERING,
remove legacy redundant visibility change flow.
3) Detach view from window when STATE_NONE
4) Refine OneHandedState static field definition
5) Consolidate OneHandedTutorialHandlerTest
Test: atest WMShellUnitTests
Test: atest OneHandedTutorialHandlerTest
Test: adb shell dumpsys activity service com.android.systemui
Test: adb shell settings put secure one_handed_tutorial_show_count 0
Test: manual trigger OHM
Test: Trigger OHM and invoke onConfigurationChanged()
Bug: 185558765
Change-Id: I3e9666e2379bceb23e3f80f0d8617a7884100a72
1) UX mentioned the swipe gesture in 3-Button NavgationBar area
may confuse user from taping NavBar buttons(Back, Home, Recents).
They decide to disable the swipe gesture and allow user to trigger
One Handed Mode(3 Button Mode) through A11y shortcut.
However, user can still use OHM by enabled shortcut button on
both Gesture Navigation & 3-Button mode.
2) OHM gestural handler consume the touch event while window
Magnification overlap with NavigationBar area in 3-button mode,
this result Magnification function can no long obtain the control.
Bug: 184903678
Bug: 179648683
Test: manual
Test: atest WMShellUnitTests
Change-Id: Ib9a06e19d749707e6f5e08c3ef803c1681f86bbc