Commit Graph

776 Commits

Author SHA1 Message Date
Jerry Chang
6d17d410f9 Prevent caching unexpected IME shown state for legacy split
Due to DisplayImeController listens to insetsChanged and display
rotation at all time, it might caching unexpected IME shown state in
DividerImeController. Since RemoteInsetsControllerTarget only
controlling insets during split mode, it won't receive hideInsets event
when the target app request to hide IME. Thus leaving unexpected IME
state in split component. When the next time entering split screen,
it'll adjust split layout with wrong IME state.

Update to not caching IME shown state in DividerImeController if the
split is not activated.

Bug: 176846448
Test: atest WMShellUnitTests
Test: open IME and rotate and dock two apps in split mode, observed
the divider bar is interactable and there's no dim layer on the
secondary split

Change-Id: I2f63eebb208b8c987a0a05615ddef4f6feef10d6
2021-03-12 00:31:50 +08:00
Jorge Gil
fa63935a61 Merge "Update PIP menu accessiblity bounds when it is moved" into sc-dev 2021-03-10 23:51:52 +00:00
Winson Chung
56547bfd28 Merge "Hide the expand container when it's not visible" into sc-dev 2021-03-10 18:27:14 +00:00
Nataniel Borges
3f0a1f40a5 Merge "Fix enter pip parameters" into sc-dev 2021-03-10 10:37:29 +00:00
Winson Chung
b3e1bce06e Hide the expand container when it's not visible
- Update the expand container margins when available actions change
- Also defer pressed state feedback until slight duration (like in
  scrolling containers)

Bug: 182338349
Test: Try dragging pip with close menu, ensure no feedback is visible
      until the full menu shows
Change-Id: I09c88349d03ad85254ff6f5e4757a8a447149735
2021-03-09 23:38:41 -08:00
jorgegil@google.com
a5547def07 Update PIP menu accessiblity bounds when it is moved
Bug: 179337864
Test: atest PipHomeTest
Change-Id: I37ffbade283861f0013f29a86855146fd2c012de
2021-03-09 16:18:14 -08:00
Bill Lin
d6a9853d3b Merge "Fix OneHandedGestureHandler incorrect InputMonitor behavior" into sc-dev 2021-03-09 08:19:08 +00:00
Wei Sheng Shih
db3d82a4e3 Merge "Starting window performance tuning.(8/N)" into sc-dev 2021-03-09 08:00:12 +00:00
wilsonshih
11598e8243 Starting window performance tuning.(8/N)
Create splashscreen thread with priority -10 in shell for starting
window controller, the definition is moved from
AMS#TOP_APP_PRIORITY_BOOST to Process#THREAD_PRIORITY_TOP_APP_BOOST.

Create and set SplashScreenView object on the starting window after the
first simple view on the starting window drawn, in this way the
transition can be prepare early than wait the actually view was draw,
which can save some time.

Bug: 73289295
Bug: 131311659
Test: atest StartingSurfaceDrawerTests ShellTaskOrganizerTests
Test: atest SplashscreenTests
Change-Id: Ibb430a66d6b329e74d62de047fbf37205cb66a96
2021-03-09 11:13:03 +08:00
Josh Tsuji
e3c4133374 Merge "Land PIP softly (using the same physics settings as Bubbles)." into sc-dev 2021-03-09 01:44:53 +00:00
Hongwei Wang
63b565d61f Merge "Use SyncTransactionQueue in PiP" into sc-dev 2021-03-08 23:05:20 +00:00
Josh Tsuji
add6ea4e16 Land PIP softly (using the same physics settings as Bubbles).
Test: fling a bunch of pips
Bug: 169863897
Change-Id: I115bcf7adc34852612646bd9cf220af62e06c4d3
2021-03-08 16:55:06 -05:00
Mady Mellor
e15c6dd81a Merge changes from topic "mm_setSuppress" into sc-dev
* changes:
  SysUI changes for setSuppressBubble
  Track locusId visibility in ShellTaskOrganizer
  Add locus id to ActivityRecord / TaskInfo
  Bubble API: suppress bubble
2021-03-08 21:27:36 +00:00
Mady Mellor
406ca457a6 Merge "Fix gesture exclusion for bubbles" into sc-dev 2021-03-08 18:11:03 +00:00
Nataniel Borges
0e77adca1a Fix enter pip parameters
Enter pip is not a rotation test and should use the non-rotation configuration

Test: atest FlickerTests:com.android.wm.shell.flicker.pip.EnterPipTest
Bug: 167521701
Change-Id: I0df35bdc08e7ac9c07bdf7f55398004076966410
2021-03-08 16:10:46 +01:00
Wei Sheng Shih
39baa852c6 Merge "Let Launcher able to receive task launching callback(3/N)" into sc-dev 2021-03-08 04:06:56 +00:00
Bill Lin
908c5afb30 Fix OneHandedGestureHandler incorrect InputMonitor behavior
1) Fix CTS WindowInsetsBehaviorTests test fail in NavBar 3 Button mode
   When device set NavBar 3 Button mode, OneHandedGestureHandler
   will monitor the InputEvent and pilferPointers() over NavBar region
   and break WindowInsetsBehaviorTests
   a) systemGesture_excludeViewRects_withoutAnyCancel
   b) systemGesture_notExcludeViewRects_withoutAnyCancel

2) In landscape, disposeInputChannelInputMonitor in OneHandedGestureHandler

3) Add dump in OneHandedGestureHandler for bugreport

Test: atest android.systemui.cts.WindowInsetsBehaviorTests
Test: manual test check the UX feel good on 3 Button mode
Bug: 181025710
Change-Id: I4c30578f45e5a569d7b5a1698d3d30229cecb13f
2021-03-08 11:20:07 +08:00
Jason Chang
90f3cd927a Merge "Refactor to use WindowManager#getCurrentWindowMetrics() instead of using Display#getRealSize()" into sc-dev 2021-03-06 08:04:52 +00:00
Ben Lin
a4cd16baad Merge "PiP: Refine pinch-resizing by damping rotation." into sc-dev 2021-03-06 04:21:31 +00:00
Mady Mellor
f425d30004 Fix gesture exclusion for bubbles
This was happening after the stack was dismissed & came
back. I think the onDrawListener should be added / removed
when BSV is attached/detached.

We reuse BubbleStackView in S so this is probably a
regression from those changes.

Fixes: 181083993
Test: 1 - have gesture nav enabled
      2 - add bubbles, dismiss them, add more
      3 - check that bubbles are easily moveable & don't
          trigger back
Change-Id: I1176efd2e41b3c9f1adb0d756e03bcfc5837eab6
2021-03-05 15:48:20 -08:00
Hongwei Wang
5632ba9ee0 Merge "Defer onTaskInfoChanged while transitioning to PiP" into sc-dev 2021-03-05 23:26:49 +00:00
Hongwei Wang
33c42511e8 Use SyncTransactionQueue in PiP
Bug: 171393374
Test: manual, make sure PiP makes as before
Test: atest PinnedStackTests \
            WMShellUnitTests:com.android.wm.shell.pip
Change-Id: I9014f7df900a6f0a900874b4ee4f2345bb99f886
2021-03-05 14:46:48 -08:00
Mady Mellor
c9871c4de9 SysUI changes for setSuppressBubble
1) We need a way to listen for locusId, this is done via
   a new listener on ShellTaskOrganizer that is informed
   for all task info changes.
2) When locusId for focused activity changes, check for
   a bubble in data that has a matching locusId & has
   API set
3) Add suppress/unsuppress in the state change flow and
   update the views

TODO in later CL:
- animate the view being hidden / shown; handle flyout

Test: atest ShellTaskOrganizerTests BubbleDataTest BubbleXmlHelperTest (also CTS CL)
Bug: 170267239
Change-Id: I5c9bd15fa8b5b326e146efdc40916454ca1c73f6
2021-03-05 11:28:01 -08:00
TreeHugger Robot
d6973bfc1e Merge "Fix some legacy-transition timing issues in split-screen" into sc-dev 2021-03-05 18:58:34 +00:00
Mady Mellor
2dded21b4e Track locusId visibility in ShellTaskOrganizer
- Keeps track of all visible locusIds
- New listener that clients can register to find out
  about locusId visibility changes

Bug: 170267239
Test: atest ShellTaskOrganizerTests
Change-Id: I544ed9ad173ed30320c5cc104f1c473f94b537d2
2021-03-05 10:39:34 -08:00
Hongwei Wang
c504ed49fd Defer onTaskInfoChanged while transitioning to PiP
The ApiDemos app triggers onTaskInfoChanged when transitioning from
landscape to portrait PiP due to its implementation (fixed in a separate
CL in same topic). Here we defer applying the TaskInfo received in
onTaskInfoChanged till the entering transition finishes.

Video: http://rcll/aaaaaabFQoRHlzixHdtY/c1n3cqwBydRxDrwxKHqI0H
Bug: 180630127
Test: enter PiP w/ autoEnter from landscape in button navigation
Test: atest WMShellUnitTests:com.android.wm.shell.pip.PipTaskOrganizerTest
Change-Id: I3bc07dbb45a281d5c9b0bbfff7478e57b8944c60
2021-03-05 10:19:59 -08:00
Evan Rosky
86234a6ebd Merge "Abstract some transition checks so they can be expanded." into sc-dev 2021-03-05 16:48:32 +00:00
wilsonshih
8b7b5e6781 Let Launcher able to receive task launching callback(3/N)
When StartingWindowController receive addStartingWindow, send a callback
out so a listener can know whether current launch cold or warm.

Ref doc: go/starting_window_android_s

Bug: 131311659
Bug: 131727939
Bug: 152480470

Test: atest WindowOrganizerTests StartingSurfaceDrawerTests
SplashscreenTests

Change-Id: Ic9f02f51d5de141b56a8f28003bf1cb1a5a63f22
2021-03-05 21:22:59 +08:00
Winson Chung
6d2a041ca4 Merge "Update the split screen APIs used by the launcher" into sc-dev 2021-03-05 04:25:11 +00:00
Evan Rosky
b944f19d50 Fix some legacy-transition timing issues in split-screen
This does 2 things:

1. Leash-setup was originally made asymmetric to handle tasks
   switching between organized and non-organized; however, now the
   tasks don't do that so we can symmetrize this again.

2. TaskInfoChanged reporting was added to ensureActivityVisibility.
   This causes noise as it can repeatedly send unchanged TaskInfos to
   shell. The result is that the legacy split organizer will reposition
   its surface while it is on an animation leash. To avoid this, keep
   track of the last positions and only update it if it changes. This
   maintains a contract that as long as the task's actual position
   doesn't change (ie. during an animation), the shell won't clobber
   changes made by legacy-transition's leashing. This can be cleaned
   up once we move to shell transitions where ownership is better
   defined.

Bug: 172840531
Test: open 2 apps in split and observe no offset in launcher
Change-Id: I262e3a53b7497192e234d4a8ba215e10ed73a145
2021-03-04 17:59:45 -08:00
Ben Lin
bc696ba302 PiP: Refine pinch-resizing by damping rotation.
This adds:
- push back rotation starting by 5 degrees. Until the user input has
more than 5 degrees of rotation, we assume the user doesn't really want
to rotate it and only want to move/resize, so it's less jarring/jittery.
- Dampen the rotation once the user rotates past a certain amount.

Bug: 181068706
Test: Manual.
Change-Id: I0fd95d9cb2ad2eff053ce92817af22513d11cc62
2021-03-04 15:23:52 -08:00
Winson Chung
a416ee18a6 Use the right executor for callbacks in Shell code
Bug: 181814254
Test: atest SystemUITests
Change-Id: I60a196360f9ff435ce99cb5e1d42d3da400d1206
2021-03-03 17:23:55 -08:00
Hongwei Wang
c241755d1f Merge "Restrict the overridden min size for PiP" into sc-dev 2021-03-03 17:53:16 +00:00
Jeff Pierce
031bb5d835 Update the split screen APIs used by the launcher
Makes the following changes:
1. Adds a boolean visible parameter to the onTaskChanged method of
SplitScreenListener to allow the launcher to determine which task is
on top of a stage
2. Allows the launcher to specify a fill-in intent when asking to open
a PendingIntent on the main or side stages.
3. Allows the launcher to ask to remove a task from the side stage.

Bug: 179176511
Test: manually tested against the foldable taskbar launcher.
Change-Id: I9fa530f546af58779ccf71d0753d9b6d3479fd0b
2021-03-02 16:40:30 -08:00
Winson Chung
e6e1ab1571 Merge "Move PipTouchHandler initialization to shell main thread" into sc-dev 2021-03-02 23:30:30 +00:00
Hongwei Wang
8c51113135 Restrict the overridden min size for PiP
Per go/cdd-proposal-pip-size, the absolute minimum size when overridden
should be 48dp.

Bug: 174302616
Test: atest PinnedStackTests#testEnterPipWithTinyMinimalSize \
            WMShellUnitTests:com.android.wm.shell.pip
Merged-In: I2f0dfd9a79049aaf696fde8703994deaecce63f5
Change-Id: I2f0dfd9a79049aaf696fde8703994deaecce63f5
2021-03-02 15:01:31 -08:00
TreeHugger Robot
3dd7039e73 Merge "Set size compat UI to max layer" into sc-dev 2021-03-02 22:09:30 +00:00
Evan Rosky
7e3bc7154e Abstract some transition checks so they can be expanded.
This is mostly to clean-up CL diffs so its easier to tell
what is changing. The main change here is replacing naked
parint == null checks with TransitionInfo.isIndependent() which
can do extra logic to handle cases where, even though a change
has a parent, it might be animating independently with in it.
The easiest example is display rotating while an app is opening.

This also fixes a small bug when removing a non-visible task.

Bug: 179270750
Test: atest TransitionTests
Change-Id: Ibd72b0721f33602b26bcc5c7060fc959aed04377
2021-03-02 12:34:03 -08:00
Chris Li
ca5fb2f2a6 Set size compat UI to max layer
Before, the size compat UI is reparent to Task with its original layer
(likely 1), which may not be the higheset layer when the Task contains
more than one children.

Fix: 181541449
Bug: 178327644
Test: verify with launching a non-resizable activity from another
Change-Id: I9e812ca8c0c1fd5b93a6e074a5e4df164c8fa03b
2021-03-02 10:41:54 -08:00
Jason Chang
0d0b77a0e5 Refactor to use WindowManager#getCurrentWindowMetrics()
instead of using Display#getRealSize()

Since Display#getRealSize / getRealMetrics will be deprecated soon
in ag/13474172, and we also found an once issue b/180833541 that
related with it, so refactoring it.

Bug: 180833541
Test: atest WMShellUnitTests
Change-Id: I14220768b0c470ca3bdec410a107347000e9d511
2021-03-02 23:20:50 +08:00
Winson Chung
527b6ce657 Move PipTouchHandler initialization to shell main thread
- We should separate the construction from the initialization
  and make sure everything is initialized in order on the shell
  main thread.

Bug: 181262334
Test: atest PinnedStackTests

Change-Id: I4f52864972146c7440794625e1de370ecea75006
2021-03-01 23:02:00 -08:00
Wei Sheng Shih
a3b84a9a62 Merge "Extract StartingSurface interface on WMShellBaseModule(7/N)" into sc-dev 2021-03-02 04:50:28 +00:00
Jerry Chang
2f3b22c90a Merge "Fix dismissing wrong stage when droping divider to the edge" into sc-dev 2021-03-02 00:24:43 +00:00
Yuncheol Heo
83ad0adb52 Merge "Introduce a flag removeWithTaskOrganizer." into sc-dev 2021-03-01 21:13:45 +00:00
Lyn Han
69943c0ea9 Update bubble dot math for consecutive flyout
Bug: 170267642
Test: flyout-to-dot transformation okay
      for left/right stack in portrait/landscape
Change-Id: I83f41984dd8bb6ec1cbbfcf9e0a1671555ebab32
2021-02-26 23:25:08 -06:00
Mady Mellor
e0532b995f Bubble API: suppress bubble
Apps want to hide their bubble when/if the user is viewing
the same content outside of the bubble (e.g. bubble for
alice, user opens up conversation in main app for alice).

Devs can set a flag on BubbleMetadata to request this
behavior.

The match of bubble to activity is done via a locusId. So
apps must set a locusId on the notification & activity to
make this match (done in other CL).

Bug: 170267239
Test: atest NotificationManagerTest NotificationTest (see CTS CL)
Change-Id: I9f2efd3fd1ba4abdd8e579b51245d39a6be9186f
2021-02-26 18:12:46 -08:00
Yuncheol Heo
28e66c2a77 Introduce a flag removeWithTaskOrganizer.
- The flag allows us to remove the tasks which are managed by
  TaskOrganizer when TO dies.

Bug: 179676966
Test: Launch a Bubble, kill SysUi and check if the Bubble remains in
  ActivityStack.
Change-Id: Ie0ccafd2b4b0393b777b69b7fb70c0ea74f95963
2021-02-26 10:46:52 -08:00
Nataniel Borges
ca35310221 New CUJ: Swipe pip window to bottom center to close
Share the assertions between close with dismiss and close with swipe.

Bug: 172037252
Test: atest WMShellFlickerTests:PipCloseWithSwipe WMShellFlickerTests:PipCloseWithDismissButton
Change-Id: I03904f1de78d3204f9bdd0d6207ec4947f1404dd
2021-02-26 14:41:17 +01:00
Mark Renouf
20bd3d4935 Merge "Long screenshots framework update and API unhide" into sc-dev 2021-02-26 13:06:47 +00:00
Nataniel Borges
31182d2383 Merge "Promote stable app pairs tests" into sc-dev 2021-02-26 12:46:12 +00:00