Add window container transaction APIs to indicate launch root for task
launching with FLAG_ACTIVITY_LAUNCH_ADJACENT. If launch adjacent flag
root is available, consider to launch to its adjacent task if the launch
is coming from the same root task.
Fix: 169271875
Test: atest WMShellUnitTests
Test: atest TaskDisplayAreaTests
Test: manual test FLAG_ACTIVITY_LAUNCH_ADJACENT behavior with adjacent
root.
Change-Id: I1716aaa48745d2c32cd413c8eac0b1d17810f0de
Extracting StartingWindowTypeAlgorithm static nested class within
StartingWindowController into StartingWidnowTypeAlgorithm interface and
PhoneStartingWindowTypeAlgorithm class that implemets the interface.
Adding an alternative implementation - TvStartingWindowTypeAlgorithm, for
use on TV. The TV implementation always returns StartingWindowTypeAlgorithm.
Setting up TvWMShellModule and WMShellModule to provide the TV and the
Phone implementations respectively.
Also removing a redundant StartingWindowController constructor.
Bug: 182759603
Test: make SystemUI
Change-Id: I10bab125320a9cdc9e3ddaedad1c74930b681fa6
Add 2 cases with rotation change:
(a) Enter PiP from fullscreen.
http://recall/-/d6GxE5mVL8Ww2IPnx7Nk0o/hDfmdrhrBFjJNOdi1s66OW
(b) Launch fullscreen app with the existing PiP.
http://recall/-/d6GxE5mVL8Ww2IPnx7Nk0o/bUpHZ6Sh98zKZJnRM7oFy9
Steps of (a):
1. Task#setWindowingMode to PiP. If the next fullscreen activity
will change display orientation, start fixed rotation on it.
And start deferring orientation change.
2. PipTaskOrganizer#onFixedRotationStarted is called to mark it
will be a special case.
3. PipTaskOrganizer#onTaskAppeared is called and starts the PiP
rotation animation by animateResizePip with rotated destination
bounds from rotated DisplayLayout.
4. When onPipAnimationEnd, use WCT#scheduleFinishEnterPip to notify
that the animation is done, so the deferred orientation change
can continue to update (PinnedTaskController#setEnterPipBounds).
The end transaction of animation (reset matrix) is deferred
until fixed rotation is finished. Also freeze the PiP task
configuration one time, to avoid extra configuration change
(letterboxed) by rotation change.
5. The seamless rotation starts, the PiP surface is transformed
to previous rotation based on the bounds of previous step. So
the PiP task can show the same orientation as rotated display.
The frozen flag of PiP task configuration is cleared.
6. PipTaskOrganizer#onFixedRotationFinished is called. The final
PiP destination bounds and the deferred transaction of step 4
will be sent to WM.
Steps of (b):
1. Fixed rotation happens (PipTaskOrganizer#onFixedRotationStarted)
when there is an existing PiP. Apply fade-out animation.
2. PipTaskOrganizer#onMovementBoundsChanged is called to update
rotated destination bounds.
3. PipTaskOrganizer#onFixedRotationFinished is called to apply
fade-in animation with new bounds.
Other changes:
- WCT#scheduleFinishEnterPip was used to set bounds and notify
windowing mode change. That is already done by other config
change oepration of WCT. So this redundant operation is changed
to be a signal to notify that the PiP animation is done.
- Ignore calculating letterbox bounds for PiP activity because
it should fill the task.
- Add PinnedTaskController#DEFER_ORIENTATION_CHANGE_TIMEOUT_MS
to avoid using alpha animation after swiping from any task.
- Consider source rect hint with rotation.
Bug: 165794724
Bug: 175836469
Test: DisplayContentTests#testFixedRotationWithPip
PipAnimationControllerTest#pipTransitionAnimator_rotatedEndValue
Change-Id: I2c26b5d93996193caaf020bd0e2314c8e1789545
Some tests are still flaky and affecting presubmit
Bug: 185400889
Bug: 186119282
Bug: 186115871
Test: atest FlickerTests WMShellFlickerTests
Change-Id: Ie4e21d01d5ea7586f88470543321ce26ed74afa6
It's make sense to let controller manage function states,
and left organizer handle leash & transition stuffs.
Move isInOneHanded() in OneHandedState.java
Controller can get STATEs throught organizer callback:
- onTransition()
- onStartFinish()
- onStopFinsih()
Test: atest WMShellUnitTests
Bug: 185558765
Change-Id: I741b191557ed8e8ca85184d75a7bd8a2573e9b7c
1) Define STATEs flags for OHM CUJ:
STATE_NONE (0)
STATE_ENTERING (1)
STATE_ACTIVE (2)
STATE_EXITING (3)
STATE_NONE->STATE_ENTERING->STATE_ACTIVE->STATE_EXITING
- Default = STATE_NONE
- When user trigger OHM = STATE_ENTERING
- When user is in OHM = STATE_ACTIVE
- When user exit OHM = STATE_EXITING
- When user finish exiting OHM = STATE_NONE
2) Unbound one handed mode state from OHMDAOrganzier
- Move isInOneHandedMode() to OneHandedState
Test: atest OneHandedStateTest
Test: atest WMShellUnitTests
Test: manual test
Bug: 185558765
Change-Id: Ida2f23da6c4df9cbcf6903ffc9ad07fcfc73bbcb
Removing min_sdk_version for WmShell since it's not meant to be backward
compatible.
Removing lint-baseline.xml which only contains "NewApi" errors, that
won't be generated now, since min_sdk_version has been removed.
Bug: 182759603
Test: make WmShell
Change-Id: I38e4814581d6c6a8aeb8d66b1b554a5bac331f68
This adds a couple things to support "merging" of transition
animations in shell.
1. Moves the finishing surface operations into a transaction that
gets sent to shell. This does a couple things: it complies with
the contract we have where during a transition, only the player
should touch relevant surfaces; and, it makes it so that the
player can merge the transaction with other ones.
2. Keeps a queue of "pending" transition animations in shell and
either merges them or runs them serially.
3. Any transition that becomes ready while another is playing will
first be sent to the playing handler to give it a chance to
"merge" the incoming transition.
There are 3 expected responses to overlapping transition animations:
1. Cancel the currently playing transition and immediately start
the incoming one. This can be achieved by having the currently
playing transition cancel itself (ie. immediately finishing) when
a merge request comes in. Then the rest of the shell transition
logic will immediately start the next transition.
2. Queue up the incoming transition to play once the current one
finishes animating. This is basically the default as long as
the current transition simply rejects/ignores merge requests
3. Merge the incoming transition. This is achieved when the
currently playing transition actually does some special logic
to handle the incoming transition. It then calls the finish
callback for the incoming transition (before it finishes its
own animation) to indicate that it has been merged (or "consumed").
Basically, any time the finish callback for a transition is
called before a pre-ceding transition, that transition is assumed
to have been merged.
Bug: 183994113
Test: atest ShellTransitionTests
Change-Id: I3cb54e221d57642306ddf15827c21d8881b014d0
Previously in launcher quick steps, when one handed mode trigger
the gesture is easy to conflict "swipe up Recents" and
"swipe horizontal for quick switch", we only consume gesture when
SYSUI_STATE_ONE_HANDED_ACTIVE=true, however, user have a bad
experience when one handed transitioning conflict to "swipe up
to launch recents".
Legacy design :
onStartFinished() : SYSUI_STATE_ONE_HANDED_ACTIVE -> true
onStopFinished() : SYSUI_STATE_ONE_HANDED_ACTIVE -> false
New design :
onTransition() : SYSUI_STATE_ONE_HANDED_ACTIVE -> true
onStartFinished() : SYSUI_STATE_ONE_HANDED_ACTIVE -> true
onStopFinished() : SYSUI_STATE_ONE_HANDED_ACTIVE -> false
Test: atest WMShellUnitTests
Bug: 177978035
Change-Id: Iac9612b2eb07606712a4ab3eb036ac6fd3d12ae3
Reference WCAG to calculate color contrast via luminance, add this as
one condition for similar color validate.
Bug: 184830058
Test: atest SplashscreenTests
Change-Id: I93bad2a8ff813036e71757e50f82b6d0ea7f81d5
- use getPackageManagerForUser when looking up app info
- add test for it
Bug: 184041127
Test: atest BubblesTest
Test: - have a managed work profile
- install the bubbles app *only* for the work profile
- make some bubbles
=> Notice bubbles appear
- dismiss all the bubbles
- restart the device, add a bubble
- open the bubble, navigate to the bubble overflow
=> notice the previously dismissed workprofile bubbles
are in the overflow
Change-Id: I479bb717b3c365346682331b0def7170ed1a791b
* Persist bubbles per-user - rather than one list the
XML now has a list per-user. The entries in these lists
still include userId for workprofile since bubbles are
mixed in the stack / overflow for workprofile.
* When loading bubbles, only the ones for the current user
are loaded / hit bubbleController code
* When user changes, overflow data should be re-loaded
* Allow the bubble window to be visible for all users
Test: atest BubbleXmlHelperTest BubbleVolatileRepositoryTest
BubblePersistentRepositoryTest BubblesTest
Bug: 173408780
Change-Id: I88cb7cc7ee676d8e0756328a95a54fdaf018a013
The API windowSplashScreenBackground should work even when starting
window controller request to create an empty icon splash screen.
Bug: 182759603
Test: atest SplashscreenTests
Change-Id: I0c8178f27663f92acfdd0da8d216ff7ae94db981
Bug: 163076219
Test: manual
Use the flag "debug.sf.enable_hole_punch_pip" (also used by
I56e2a6debce6ede4bebfcbd32bffa01c20461542 to activate using a hole punch
to render the rounded corners) to turn on rounded corners even if
config_pipEnableRoundCorner is set to false.
This will allow testing the feature until we can turn it on.
Change-Id: I2719f8ac151895874ab22e4cd7e64c9e1dc9eac8
trigger One-Handed mode many times quickly in a short time
To prevent entering or exiting OHM quilcky in a shot time.
Bug: 185304468
Test: manual
Test: atest WMShellUnitTests
Change-Id: Ibc5ade564da241d5871b3b037c97bd68a6b03a5d
- Move new matrix/rect construction to if the param is set on the
builder, we only apply the params if the flags are set anyways
and if the caller doesn't set those params then we are allocating
new objects unnecessarily
- Always recycle motion event
Bug: 183756396
Test: Take memory profile when dragging pip
Change-Id: Ie7457c8c508ee61bd27daeebe486c39a5cebe7d7