Commit Graph

617 Commits

Author SHA1 Message Date
Tony Huang
76522e9938 Fix divider display issue
onDisplayAreaInfoChanged might callback many times in one action
such like fold to unfold, it might cause some issues because we
don't use lastet config resources to set SplitLayout.

Another bug is we cannot get divider leash immediately after we
init it because leash is built after attachToParentSurface.

Fix both bug by always do whole SplitLayout setting if any cared
configs changed. And add a callback after divider leash build,
show the leash on this callback to ensure we got null leash.

Fix: 198581512
Fix: 197296095
Test: manual
Test: pass existing tests
Change-Id: I06a4093927d6469a85b2104b36c16d6e16519a51
2021-09-16 11:39:13 +08:00
TreeHugger Robot
5b04dc7c7e Merge "More improve IME transition during task switch" into sc-v2-dev 2021-09-15 01:05:12 +00:00
Mady Mellor
e176359fa4 Merge changes I477f34de,I74b0d66c,I3c93e472 into sc-v2-dev
* changes:
  Animate the pointer when IME comes up
  Hide the overflow when the IME comes up sometimes
  Shift bubbles for IME on large screens
2021-09-14 22:24:02 +00:00
Mady Mellor
56b1b2d2d5 Hide the overflow when the IME comes up sometimes
If there isn't enough space to show all the bubbles
when the IME is up on large screens, then hide the
overflow.

Really the overflow isn't hidden, it just doesn't
get shifted up above the IME like the actual bubbles.

Made a little helper class to hold stack state info
and pass that around.

Test: manual - on large screen that can't fit max #
               of bubbles when IME is up, select the
               last bubble & check that IME shifts
               all the bubbles but the overflow
Bug: 193911220
Change-Id: I74b0d66cedf70cca40a36b07933ebf6466da63b7
2021-09-14 12:02:36 -07:00
Ming-Shin Lu
8169ca0188 More improve IME transition during task switch
This CL aims to optimize the previous CL[1] to schedule removing
tasksnapshot after a fixed timeout according the tasksnapshot:
    - With IME snapshot: 350ms
    - Without IME snapshot: 100ms

As the previous approach has some cons espically when the tasksnapshot
has IME shown:
1) It lacks a signal or callback to notify WmShell to dismiss
tasksnapshot when IME is actually drawn on the task and always
dismissed after the timeout.

2) The timing to schedule tasksnapsit removal is when
ActivityRecord#onWindowFirstDrawn, which is much eariler than the
window focused (about 100-150ms), and it may easier to see flickering
when the task is showing IME.

The reason is that IME is drawn after window focused and started input
connection. Also, starts from R, IME insets visiblity
is handled by the app's UI thread, so if the schedule removal timing
been triggered too early and if IME / App takes more time to handle IME
surface layout, then user might aware the app task flickering when
tasksnapshot dismissed, since IME is not yet be drawn and then it
show up again when the next layout finished.

In this CL, we made the following changes to improve the above cons
- Postpone the schedule removing tasksnapshot (with IME) timing to
  after the app task has focused.
- Modify the tasksnapshot removal timeout (with IME)  from 350ms to
  450ms (with renaming to MAX_DELAY_REMOVAL_TIME_IME_VISIBLE),
  in case some edge cases may take longer time to process IME layout.
- add ITaskOrganizer#onImeDrawnOnTask(taskId) to notify the shell
  task organizer to properly remove the tasksnapshot without waiting
  until the max timeout.

[1]:  I5fb0fa3a1e6a5e6210d3baf400a84c5892bd2e34

Fix: 192065018
Test: ateset StartingSurfaceDrawerTests#\
        testRemoveTaskSnapshotWithImeSurfaceWhenOnImeDrawn
Test: manual tests by
   1) launching Android Message with focusing an editor
   2) swiping out to home and launch another apps (e.g. chrome)
   3) swiping up to overview, tapping Android Message task
   4) verify if IME is flickering after switched back.
Change-Id: I81031f64966b1aeb55cc09f381d4d83ec3460dc9
2021-09-13 18:04:05 +08:00
Vinit Nayak
2d113fb2a3 Merge "Update split screen interface to indicate dismissing to top task" into sc-v2-dev 2021-09-09 20:19:19 +00:00
wilsonshih
c86f1eb19e Use SystemUI theme to inflate FrameLayout and SplashScreenView
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
2021-09-06 08:34:55 +00:00
Jerry Chang
c8a54dab1d Update split screen interface to indicate dismissing to top task
Bug: 198310766
Test: atest WMShellUnitTests
Change-Id: I78824605575825a41eb2e507123705bfca6482a2
2021-09-06 10:42:54 +08:00
TreeHugger Robot
6bd19fab1c Merge "[DO NOT MERGE] Sync flicker from master to sc-v2" into sc-v2-dev 2021-09-04 00:15:31 +00:00
Evan Rosky
ac3bddc1ce Merge "Wrap IRemoteTransition in a parcelable to enable extra properties" into sc-v2-dev 2021-09-03 19:53:10 +00:00
Evan Rosky
bc94c3d524 Wrap IRemoteTransition in a parcelable to enable extra properties
This is in preparation for attaching some extra meta information
to remote transitions (eg. process token). Most of this refactor
just replaces references to the raw interface with references
to the wrapper class.

There is also a small refactor in RemoteTransitionHandler to
better-manage death-recipients. It is possible to have >1 filter
and >1 pendings referencing the same remote simultaneously, so
this arrangement properly handles the 1-to-many possibility.

Bug: 183993977
Test: refactor, so existing tests pass
Change-Id: Icae8f2128e0ffdf7aee51284cba106963450e3e7
Merged-In: Icae8f2128e0ffdf7aee51284cba106963450e3e7
2021-09-03 17:19:44 +00:00
Winson Chung
851f1df2f1 Return the existing display ids when registering a display window listener
- This ensures that the caller can synchronously initialize the existing
  displays without waiting for the onDisplayAdded() callback, which can
  happen asynchronously (since the callback is oneway).

Bug: 196186963
Test: atest WMShellUnitTests
Test: atest ActivityTaskManagerServiceTests
Change-Id: I0a8d5f9b4ede7b487a8de14bdb6eaacae7d03d9f
2021-09-01 13:37:31 -07:00
Nataniel Borges
c8287a930f [DO NOT MERGE] Sync flicker from master to sc-v2
Flicker on master diverged form sc-v2, to make it easier to debug
flicker issues on sc-v2, push the current version of flicker into sc-v2

Test: atest FlickerTests WMShellFlickerTests
Bug: 188792659
Change-Id: I1c832bf32214b12ba4b708bccfc95cf259324844
2021-09-01 12:06:21 +00:00
Jerry Chang
5514e76d40 Draw rounded corners beside split divider bar
Draw rounded corners beside divider bar which inset with task bar if
the task bar is expanded.

Bug: 196272915
Bug: 182511830
Test: atest WMShellUnitTests
Test: manul check the rounded corners rendered in proper position.
Change-Id: I14c5a9416d52bf06b3e4c8ac843c5a65c0b940b8
2021-08-30 19:39:03 +08:00
Jerry Chang
a99034d9c6 Only run PipLegacySplitScreenTest when it is using legacy split
Ignore PipLegacySplitScreenTest if the system is not using legacy
split by checking config_useLegacySplit which is set to false since
sc-v2 or on jumbojack device. The flag should be deprecated along with
legacy split screen.

Bug: 189245318
Test: atest PipLegacySplitScreenTest
Change-Id: I6243f0b0990265c96867cb7ee87b6bd0b90330c7
2021-08-27 10:06:31 +08:00
TreeHugger Robot
fc7ff7b7e2 Merge "Only run legacy split flicker tests when it is using legacy split" into sc-v2-dev 2021-08-19 07:19:39 +00:00
Jerry Chang
66e7ff7937 Only run legacy split flicker tests when it is using legacy split
Ignore legacy split flicker tests if the system is not using legacy
split by checking config_useLegacySplit which is set to false since
sc-v2 or on jumbojack device. The flag should be deprecated along with
legacy split screen.

Bug: 189245318
Test: pass existing tests
Change-Id: Ic3dfbe849e7fcc9f25e44b7ff37ad00fdee60e9a
2021-08-19 06:01:00 +00:00
Ben Lin
e266d53aa5 Merge "Fix PiP rotation when Shell Transition is on." into sc-v2-dev 2021-08-18 23:48:09 +00:00
Ben Lin
fa097e1fa8 Fix PiP rotation when Shell Transition is on.
Also fixed the associated flicker tests.

Bug: 193565745
Bug: 165793917
Test: atest
Change-Id: I5156aa0236e704d46badd28b8093174a04f329ea
Merged-In: Iebd847ab0d7dc394fc64bb54cdc5262db7b9f1b0
2021-08-18 23:04:04 +00:00
Mady Mellor
af3974cb9b Merge "Center bubbles horizontally on large screens" into sc-v2-dev 2021-08-18 19:42:38 +00:00
Winson Chung
1c61be35a5 Add logging for splitscreen
- Log split enter/resize/swap/change/exit as per
  go/dragdrop_splitscreen_logging
- Pass drag session id and drop info to splitscreen controller

Bug: 191686897
Test: statsd_testdrive -e -terse 388 (and verify events from manual
      interaction)
Test: atest WMShellUnitTests
Change-Id: I2d11bffa2fa41a2cd77e78b12d94082d19dc2d6c
2021-08-18 00:36:01 +00:00
Mady Mellor
9c06ec645a Merge "Fix an issue where the bubble overflow wouldn't animate when collapsing" into sc-v2-dev 2021-08-16 15:15:35 +00:00
Selim Cinek
0ed0e27c58 Merge "Don't create one-handed-background-panel after rotation" into sc-dev am: ab89e910bc am: 193406410a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15537318

Change-Id: I975aacd72bcd5bd12d6e410c4f798034962b8020
2021-08-16 12:01:39 +00:00
Mady Mellor
4d1f0d16b5 Fix an issue where the bubble overflow wouldn't animate when collapsing
When we collapse we'd update the selected state from the overflow to
the top bubble. This would update mExpandedView in stackView which
would mean the top bubble view would be told to animate instead of
the overflow even though it's still what's visually selected.

This changes the selected state to be set to the top bubble the
next time the stack is expanded instead of while its collapsing.

Bug: 196444758
Test: atest BubbleDataTest
Test: manual - navigate to the bubble overflow and tap outside, verify
               that the overflow animates out just like if you were
               collapsing from a convo bubble.
Change-Id: I1182d48916013dcc8aa15fb188543d8689b1f8a6
2021-08-13 15:21:57 -07:00
Mady Mellor
e7981bb2b2 Center bubbles horizontally on large screens
Previously bubbles were anchored to the edge they were
expanded on, with the expanded view next to it.

This CL modifies it such that the bubble expanded view
will be centered, and the bubbles will be anchored to
the expanded view.

BubblePositioner is updated to return the x,y of the
bubble. This allows an x value to be specified
to inset the bubble positions on large screens.

Updates phone landscape layout to have padding at the
top (to match with tablet layouts). The bubble
overflow is modified to be full height with top &
bottom padding in phone landscape.

Fixes an issue where we were scaling more than needed
in landscape.

Test: manual - check expanded layout in phone, phone
               landscape, and tablet.
             - check with gesture nav & 3 button
             - check everything looks fine after a
               display size & orientation change
Bug: 193910391
Change-Id: Iba4a3ac0932f716eea929fc0d8e8ef7f1b1e3f5e
2021-08-12 16:29:52 -07:00
Chris Li
a5e7ce9b16 Merge "Invoke keyguard going away when it is collecting for wake" into sc-v2-dev 2021-08-12 18:32:53 +00:00
Bill Lin
27da5b04d4 Don't create one-handed-background-panel after rotation
From code flow, when onConfigurationChanged() by rotating
OneHandedBackgroundPanelOrganizer#showBackgroundPanelLayer()
will be invoked and then create one-handed-background-panel
even though OHM is not activated.
Besides, this could introduce overhead on SF.

Test: manual rotate and dumpsys check HWC layers
Test: atest WMShellUnitTests
Bug: 196306312
Change-Id: Ia766078d5c76b08ab5b24e0ce965ad1d085e4686
2021-08-12 17:29:27 +08:00
Ben Lin
1b1cadef6f Merge "Disable PipLegacySplitScreenTest when Shell Transition is on." into sc-v2-dev 2021-08-12 06:27:05 +00:00
Winson Chung
2e990c1f26 Merge "Extract remote insets controller out of DisplayImeController" into sc-v2-dev 2021-08-11 17:17:33 +00:00
Wei Sheng Shih
7dd382e0e9 Merge "Use window manager global to add/remove starting window." into sc-v2-dev 2021-08-11 01:38:26 +00:00
Chris Li
2c0834c5e5 Invoke keyguard going away when it is collecting for wake
Before, when KEYGUARD_GOING_AWAY is called before WAKE starts,it will
not be passed to the keyguard service to dimiss keyguard. Now, we
merge the flags and add check for that.

Bug: 193564917
Test: check with/without sEnableRemoteKeyguardAnimation
Change-Id: I28d40664b4fbdc0ea199baa32ccefba7dea473f8
2021-08-10 11:26:31 -07:00
wilsonshih
1de8d00ef7 Use window manager global to add/remove starting window.
Bug: 194420095
Test: verify no IllegalAccessException log by simulating create splash
screen window with non-system ui context.

Change-Id: I9bf1434f74fa7583c004d96dc974abd1a4acf05a
2021-08-10 19:39:24 +08:00
Winson Chung
0ac518cce9 Extract remote insets controller out of DisplayImeController
- Moved into DisplayInsetsController so that other shell components
  can listen to changes as well
- Expose the insets to DisplayController's DisplayLayout so that we
  can account for the extra nav bar insets from the task bar

Bug: 182905588
Test: atest DisplayInsetsControllerTest
Change-Id: Ie481282c9a71e02a77ce6b2cf8c2dcf4b8e452c6
2021-08-09 20:04:35 -07:00
Ben Lin
e920199761 Disable PipLegacySplitScreenTest when Shell Transition is on.
Bug: 193565745
Test: atest
Change-Id: I3055d461ae00d8e0e97e971897d7df24107dfc3f
2021-08-09 17:14:20 -07:00
Jerry Chang
70fb265591 Merge "Make divider bar flings smoother when snap-to-dismiss split" into sc-v2-dev 2021-08-09 14:06:59 +00:00
Jerry Chang
bc1eba66ec Make divider bar flings smoother when snap-to-dismiss split
Bug: 195699800
Test: dismissing stage split with divider bar will fling the divider bar
      smoothly to the edge of the screen before split been dismissed.

Change-Id: Ic3bb2d9bc6da82773b7818c70dc535a5cea8e437
2021-08-09 11:30:10 +08:00
Evan Rosky
bc047eeedd Differentiate seamless rotations in shell transitions
Shell owns the whole display rotation animation now. So, we
can just provide enough information for it to decide when
seamless is requested/appropriate. The default behavior (when
not explicitly animating) is already a jump-cut/seamless, so
just skip the rotation animation if we are doing seamless

Bug: 194693472
Test: atest SeamlessAppRotationTest ShellTransitionTests
Change-Id: I64748f5910c04784fd9818818b029fa5f1339c6c
2021-08-05 10:11:52 -07:00
Mady Mellor
3289ae9f64 Update the flyout width to be smaller on large screens
On phone we use 60% of the screen which is huge on
tablet. This change uses 30% of the screen for the
flyout on large screens & enforces a minimum for
that value.

Test: manual - get a long message in a bubble on a
               tablet, it should have similar width
               as it does on phone.
Bug: 186776550
Change-Id: I500c566edd9941dc2bd149692eaf95c6e6f4aa61
2021-08-02 14:03:01 -07:00
TreeHugger Robot
0b7f506aa9 Merge "[DO NOT MERGE] Full - Compatibilize winscope with master" into sc-v2-dev 2021-07-30 14:47:23 +00:00
Jerry Chang
581d500ee6 Merge "Fix the content of the bottom split being truncated while showing IME" into sc-v2-dev 2021-07-30 12:17:48 +00:00
Jerry Chang
da44526b9b Fix the content of the bottom split being truncated while showing IME
Freeze the configuration size when shifting split layout so that client
apps can calculate insets properly and won't get config or relaunch.

Fix: 192410210
Test: atest WMShellUnitTests
Test: verified the content of the bottom split won't be truncated when
adjusting split layout with IME and won't get relaunch.

Change-Id: I38da063ffacc19b691c14b74d118949293414492
2021-07-30 16:00:57 +08:00
Evan Rosky
cc3b202fab Merge "Add some more transition filter properties" into sc-v2-dev 2021-07-30 01:41:51 +00:00
Evan Rosky
adb7e53532 Add some more transition filter properties
These are needed for keyguard transitions. The ones added are:

A NOT requirement which will reject transitions with a matching
change.

The ability to match containers that aren't independent.

Checks for global transition flags as well as individual change
flags.

Match only if container is a task.

Bug: 191799478
Test: atest ShellTransitionTests
Change-Id: I963c6c91cdfc0b71a75ba9656261bb0e237f11f1
2021-07-29 15:05:24 -07:00
Jason Chang
47abd6c2b2 Merge "Fix tutorial background color not up-to-date occasionally" into sc-dev am: 3ebd024a80
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15373613

Change-Id: I1cba57040d1b3d78a096f8336359fd0e3d64e52f
2021-07-29 19:06:03 +00:00
Wei Sheng Shih
8ea3583b8d Merge "Correcting the package name used on splash screen window." into sc-dev am: 0793f65c95
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15358033

Change-Id: I28623c6b9596275536a1e3f979cd9650f8082b3e
2021-07-28 14:49:43 +00:00
Nataniel Borges
3dab1eaeec [DO NOT MERGE] Full - Compatibilize winscope with master
Bug: 194813677
Test: none
Change-Id: I88e0e6d5b75ae3511491d6711279b951b3d9c761
2021-07-28 07:23:14 +00:00
Winson Chung
c7f047b287 Disallowing dragging to fullscreen
- Removing some tests related to dragging tasks to fullscreen and
  dragging non-resizeable tasks (supported now)

Bug: 182981887
Test: atest DragAndDropPolicyTest

Change-Id: I492b69ab81964e94db2e23b3ee11093e62040a35
2021-07-27 13:32:32 -07:00
Jason Chang
3ebd024a80 Merge "Fix tutorial background color not up-to-date occasionally" into sc-dev 2021-07-27 16:00:30 +00:00
Jason Chang
f40204087c Fix tutorial background color not up-to-date occasionally
1. Fix bug in the legacy code flow
   - Obtain color from contextThemeWrapper Theme_DeviceDefault_DayNight
   - In OneHandedDisplayAreaOrganizer#finishOffset()
     Remove redundant call "cb.onStartTransition" due to
     ambugiuous.

2. Improve performance
   - Remove redundunt callbacks.
   - Avoid create/remove leash on each start/end cycle.
   - Dispatch Transaction to bkg leash through onAnimationUpdate()
     bkg leash apply the same Transaction of display area.
   - Adjust animation duration of Tutorial panel.
   - Move bkg leash depend on yPos value to reduce SF
     componsition overhead.

3. Improve code readibility
   - Code flow : Register -> onStart() -> show  background ->
     detach background -> Unregister -> remove leash.
   - Remove redundant synchronization due to wmshell already
     guarantee thread safe.
   - Move getTranslationFraction to SettingsUtil.
   - Move getTransitionDuration to SettingsUtil.

Bug: 194507756
Bug: 193589897

Test: Local verify when changing dark theme and wallpaper theme.
Test: atest WMShellUnitTests
Change-Id: Ib55753be9e9f4665c20ad34437f86bf80cc9f3b4
2021-07-27 15:20:19 +08:00
wilsonshih
7a7722abe0 Correcting the package name used on splash screen window.
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
2021-07-23 16:50:01 +08:00