Commit Graph

234 Commits

Author SHA1 Message Date
Jorge Gil
990f36728b Merge changes I423219e9,Id5636cfc
* changes:
  Move movement bounds into PipBoundsState
  Move normal and expanded bounds into PipBoundsState
2020-11-13 21:56:15 +00:00
Sergey Nikolaienkov
a2b16e18ec Merge "Do not call assumeTrue(isTelevision) in @After" 2020-11-13 16:35:48 +00:00
Wale Ogunwale
40901fa082 Merge "App-pairs baseline commit" 2020-11-13 14:35:57 +00:00
Bill Yi
6433688129 Merge "Import translations. DO NOT MERGE ANYWHERE" 2020-11-13 14:19:46 +00:00
Wale Ogunwale
fe8c73b18d App-pairs baseline commit
- AppPairs: Main interface used to pair and unpair tasks.
- AppPairsController: Main controller for app-pairs and implements
AppPairs interface.
- AppPair: Manages a singal instance of an app-pair consisting of a
root task and 2 other tasks that are paired together.
- AppPairPool: Helper object pool for AppPair class so we don't have to
wait for a root task creation from system_server when we need an
app-pair.
- adb shell commands for pairing and unpairing tasks

Test: adb shell commands for pair/unpair
      adb shell dumpsys activity service SystemUIService WMShell \
        pair taskId1 taskId2
      adb shell dumpsys activity service SystemUIService WMShell \
        unpair taskId
Test: AppPairTests, AppPairsPoolTests, AppPairControllerTests
Bug: 172704672
Change-Id: Ie0a70c1aa764ad83b763931501234c1960251ca4
2020-11-13 21:33:38 +08:00
Sergey Nikolaienkov
327e175409 Do not call assumeTrue(isTelevision) in @After
Only call assumeTrue(isTelevision) during test setup (@Before), and do
not call it in teardown (@After), which causes tests to fail instead of
be slipped.

Bug: 171520419
Test: atest WMShellFlickerTests
Change-Id: I12f72d46a63c497686f0da7c4763ae79bbeb7dcd
2020-11-13 10:10:07 +00:00
TreeHugger Robot
b8b238ee60 Merge "Import translations. DO NOT MERGE ANYWHERE" 2020-11-13 08:56:13 +00:00
Bill Yi
900019eed9 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: Idec787e63b7c639d0926b08ecd6638acfc200e00
2020-11-12 16:06:32 -08:00
Bill Yi
9a0801dfa4 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I76acee8bb5fad886f9b181f81c86467ddca25423
2020-11-12 15:38:07 -08:00
TreeHugger Robot
90db0daf07 Merge "Fix IME always focusing bubbles" 2020-11-12 19:39:03 +00:00
jorgegil@google.com
4f93268de7 Move movement bounds into PipBoundsState
Bug: 169373982
Test: com.android.wm.shell.pip
Change-Id: I423219e9093f52edbd84ef52b928219679e187bc
2020-11-12 11:14:36 -08:00
jorgegil@google.com
8dcbe0c9bf Move normal and expanded bounds into PipBoundsState
Bug; 169373982
Test: com.android.wm.shell.pip

Change-Id: Id5636cfc7c9cfa828dd51f1a79e2ba1ed3b79c42
2020-11-12 11:13:07 -08:00
Sergey Nikolaienkov
ded47e0d1d Merge "Report if SystemUI crashes during TV Pip tests" 2020-11-12 18:47:05 +00:00
Mady Mellor
ca8244d800 Fix IME always focusing bubbles
Test: have a bubble, open it, focus IME, remove bubble, open anything else
      and check that the IME still works.
Fixes: 172977221
Change-Id: I73d57d81d274f5af0e8f69e158f3ccb862e0d379
2020-11-12 10:05:01 -08:00
Jorge Gil
5384885a56 Merge "Rename PipBoundsHandler to PipBoundsAlgorithm" 2020-11-12 16:53:00 +00:00
Sergey Nikolaienkov
af5c8ad1cd Merge "More TvPipMenuTests tests in WmShell" 2020-11-12 06:07:21 +00:00
Shawn Lin
f076bba8e2 Merge "Support hide display cutout with display area" 2020-11-12 04:49:35 +00:00
madym
54db2fb08e Merge "Add mady to Shell/OWNERS" am: 708e1e5995 am: 8ee7052466 am: 8365756bc7 am: 19cd892b9e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1496467

Change-Id: I12ca72a0c312efc27b77796218fc3b1729f01310
2020-11-12 00:54:46 +00:00
Mady Mellor
ed1098532d Merge changes I36b9cedc,I79948a4b
* changes:
  Allow Bubble overflow to be opened without other active bubbles
  Flexible bubble sizing & fixed position
2020-11-12 00:26:43 +00:00
Mady Mellor
157cd3f736 Allow Bubble overflow to be opened without other active bubbles
Currently you can only access the overflow if you have bubbles in
the stack. There are a bunch of explorations that show accessing
the overflow without the stack (e.g. from taskbar, from people area).

- BubbleData holds onto BubbleOverflow now
- When last bubble is removed, if showing in taskbar/already expanded
  & has overflow bubbs, select the overflow.
- No longer null out BubbleStackView when no more bubbles, this
  allows overflow to continue to show
- Added tests for overflow behaviour in BubblesTest

Test: atest SystemUITests
Test: manua 1) - produce a bunch of bubbles
               - expand the stack, dismiss each bubble
               => when you dismiss the last one, overflow selected
               - collapse the stack
               => overflow goes away
            2) - have taskbar cl / prototype
               - have bubbles in the overflow but no active bubbles
               => observe that taskbar shows the overflow (i.e. sysui
                 renders the stack in that spot)
Bug: 171322463
Bug: 167413172
Change-Id: I36b9cedc492ace59105dba58c89f9ef92ff4b9e8
2020-11-11 12:58:12 -08:00
Mady Mellor
97fcd7a082 Flexible bubble sizing & fixed position
This will enable some stuff for taskbar & hopefully make customizations by
ARC++ easier??

- BubblePositioner now tracks the size of the bubble & bitmap within it.
  Have to use a multiplier to derive the size of a couple of things now
  (e.g. bitmap size)
- BubblePositioner now tracks the position of the bubble stack & allows
  a way to override / set a fixed position. If something is in fixed
  location, it is not draggable (however when expanded you can still
  drag individual bubbles to dismiss)
- BubblePositioner tracks some taskbar related info
- Rather than checking for "isLandscape" we want "showBubblesVertically"
  (e.g. device might not be landscape but should be vertical if taskbar)
- Fixes an animation issue where bubbles super-overshoot the y position
  when expanding vertically.

Bug: 167413172
Test: a lot of manual testing
Test: atest WMShellTest SystemUITests
Change-Id: I79948a4bd6b58fb3aa2f52e2553f3dfc31630cf1
2020-11-11 12:57:29 -08:00
Jorge Gil
3131ab322a Merge "Remove unused imports in PipController" 2020-11-11 20:14:35 +00:00
Ben Lin
a5a96475fb Merge "Enable PiP stashing." 2020-11-11 19:19:59 +00:00
jorgegil@google.com
67959b765d Rename PipBoundsHandler to PipBoundsAlgorithm
Now that all state handling has been moved out of
PipBoundsHandler, this CL renames it to
PipBoundsAlgorithm and cleans up its public API
so that it functions more like an utility to
calculate several types of "bounds" related to PIP
such as:
- Default bounds
- Normal bounds
- Movemement bounds
- Entry bounds
- Bounds adjusted to aspect ratio
- Inset bounds

PipBoundsAlgorithm's is then only responsible for
calculating such bounds based on the current state of
PIP (owned by PipBoundsState) but it no longer owns
or manages the state, as that would be the
responsability of its users (e.g PipController).

Bug: 169373982
Test: atest com.android.wm.shell.pip
Change-Id: I67c3004b60069160f82d7c3d00d8c3995c0c5f80
2020-11-11 11:07:23 -08:00
Mady Mellor
be0403bcfc Add mady to Shell/OWNERS
Bug: none
Test: none
Change-Id: Ib552ee4a77002eeb089091084cc7d1a4c845e142
2020-11-11 10:09:10 -08:00
Sergey Nikolaienkov
b28adf0d2d More TvPipMenuTests tests in WmShell
Bug: 171520419
Test: atest WMShellFlickerTests:TvPipMenuTests
Change-Id: I0ffdcc8d7fbae636288bd6b4fbfd567cb1cacac0
2020-11-11 15:41:00 +00:00
Sergey Nikolaienkov
44ede0b9e6 Report if SystemUI crashes during TV Pip tests
Bug: 171520419
Test: atest WMShellFlickerTests:TvPipMenuTests
Test: atest WMShellFlickerTests:TvPipNotificationTests
Change-Id: Id272b67dec36b5b3a0ffa0713ecd736cb64befd5
2020-11-11 15:36:39 +00:00
shawnlin
8dd26b237d Support hide display cutout with display area
- Added a new DisplayArea feature for hide display cutout
- Added a new config for enable/disable hide display cutout
- Resize and shift display areas to exclude the cutout areas.
- Force dark status bar when there is a cutout area at top
- Update bounds & offsets for different rotations.

Bug: 157388722
Test: atest HideDisplayCutoutControllerTest
      atest HideDisplayCutoutOrganizerTest
      atest WMShellTest
Change-Id: Iad2c8b1eff1ea4523f8a7e362c9e851d8594141c
2020-11-11 19:40:57 +08:00
Winson Chung
23a59b02fd Fix issue with persistent drag window
- The drag count needs to be per-display since using a global count
  would prevent us from hiding the window for the non-last display

Bug: 169894807
Test: Drag and drop with a foldable device and ensure that no drag
      window lingers for a secondary display
Change-Id: I5bb26d07c143ab4f062deb34f1564735a095817f
2020-11-10 23:49:33 -08:00
Ben Lin
4608b945db Enable PiP stashing.
Bug: 165793553
Test: Stash PIP
Change-Id: I8ba760babc6ee64a25dc8231fb240e21b863e069
2020-11-11 02:34:53 +00:00
Wei Sheng Shih
079f596c4e Merge "Delegate splash screen starting window to SystemUI(1/N)" 2020-11-11 02:30:02 +00:00
Ben Lin
a0131174f9 Merge "Change PiP stash to be based on velocity rather than position." 2020-11-11 02:28:34 +00:00
Jorge Gil
fbbd652eb6 Merge "Move IME & shelf visibility/height into PipBoundsState" 2020-11-10 23:26:34 +00:00
Ben Lin
05476b3ace Change PiP stash to be based on velocity rather than position.
Also only allow stashing if user starts dragging from that edge.

Bug: 165793553
Test: Stash PIP via flinging
Change-Id: Icfd6d8d580cfb96b148f7712d0aedfcee1f30b2d
2020-11-10 22:37:40 +00:00
Sergey Nikolaienkov
8817872a73 Merge "Null-check on PipMenuController." 2020-11-10 22:31:42 +00:00
jorgegil@google.com
8097a52cc7 Remove unused imports in PipController
Bug: None
Test: m -j
Change-Id: I640ce26e60eda056584e0db06df9f328a6831ea2
2020-11-10 14:10:41 -08:00
Jorge Gil
26d7201645 Merge "Refactor getDestinationBounds into more readable methods" 2020-11-10 20:34:49 +00:00
Ben Lin
ae927f9723 Null-check on PipMenuController.
For now, TV PiP does not have a menu controller.

Bug: 172909450
Test: None
Change-Id: I0f8a6628607568e71dab795eda255972f00c8b44
2020-11-10 11:24:45 -08:00
Ben Lin
63336329a3 Merge "Add PiP exclusion logic in EdgeBackGestureHandler." 2020-11-10 19:15:42 +00:00
jorgegil@google.com
d6349bb46b Move IME & shelf visibility/height into PipBoundsState
Bug: 169373982
Test: com.android.wm.shell.pip
Change-Id: I411d857c57e2dc593c3506318f5ce1ab6d625b08
2020-11-10 10:19:12 -08:00
jorgegil@google.com
a61e9fec04 Refactor getDestinationBounds into more readable methods
getDestinationBounds(Rect) was only being used to calculate
the "entry" bounds (e.g. onTaskAppeared, swipeToHome) and
all its callers were passing in null.
getDestinationBounds(Rect, boolean) had only one caller,
onTaskInfoChanged, who did pass the current bounds in to
be adjusted to the aspect ratio.

Instead of having overloaded methods and complex logic to
know whether to calculate default bounds or use the provided
bounds, the method is now split into two methods that better
represent what they're calculating:
1. getEntryDestinationBounds, no arguments, calculates either
default or reentry bounds
2. getAdjustedDestinationBounds, takes in the current bounds
and the new aspect ratio, simply adjusts the bounds to the
aspect ratio.

Bug: 169373982
Test: atest com.android.wm.shell.pip
Change-Id: Ie8adda458fc5a56b9d78245c663dbc54b8525378
2020-11-10 10:11:33 -08:00
Winson Chung
b73cc69fbc Merge changes from topic "shell_task_stack_listener"
* changes:
  6/ Fix some flakey issues with dragging to split
  Clean up task stack listeners
2020-11-10 17:24:57 +00:00
Sergey Nikolaienkov
108951ecb3 Merge "Add TvPipMenuTests" 2020-11-10 09:22:41 +00:00
wilsonshih
c1c4c5a661 Delegate splash screen starting window to SystemUI(1/N)
Mirror PhoneWindowManager#addSplashScreen to StartingSurfaceDrawer,
which make WMShell able to draw the splash screen starting window.

- Use StartingSurfaceController#DEBUG_ENABLE_SHELL_DRAWER to switch
drawer when developing this feature.

- Temporarily put StartingSurfaceDrawer in ShellTaskOrganizer, the
drawer should be controlled by a controller which should be create
while porting ActivityRecord#addStartingWindow to Shell.

Ref doc: go/delegate_starting_window

Bug: 131727939
Test: atest AppWindowTokenTests WindowOrganizerTests ActivityStackTests
Test: atest WMShellTest ShellTaskOrganizerTests
StartingSurfaceDrawerTests
Test: check from winscope that the splash screen window can
attach to/detach from the ActivityRecord.

Change-Id: I6dfc9ff75807e2f9479149d14f219c91a6527393
2020-11-10 15:49:07 +08:00
Winson Chung
6dd73e98d7 6/ Fix some flakey issues with dragging to split
- Ensure that the task info activity type always matches the actual task
  activity type (can be different than the window configuration type)
- Ensure that the targets hit rects respect the insets, and that dragging
  out of all targets (but still within the window) will hide the last
  target
- Work around race with launching secondary task when splitting, wait
  until the split screen task org has moved existing tasks to secondary
  split root before starting the new task, and also update the home task
  position when going home (b/172686383)
- Add a timeout to clean up drag surfaces if SysUI crashes while
  mid-drag
- Clean up some other calls to get activity type/win mode

Bug: 169894807
Test: atest DragDropControllerTests
Test: atest DragAndDropPolicyTest
Test: atest SplitScreenTests
Change-Id: I7ae11cc38b1e927d955798ef1056e17c9e435758
2020-11-10 05:46:24 +00:00
Ben Lin
accac9b578 Add PiP exclusion logic in EdgeBackGestureHandler.
Bug: 165793553
Test: Stash PIP

Change-Id: Ia3bf9a02455ac736b33b4d2c87fddd06b503f618
2020-11-09 11:28:07 -08:00
Winson Chung
e3d75ac262 Clean up task stack listeners
- Have shell provided a task stack listener that various controllers can
  add to, and remove registration from outside the controllers (this
  also removes methods on the interface exposed only for use from the
  task stack listeners)
- Move copy of InputConsumerController into shell (shared lib version
  can probably be refactored into use just by launcher for gesture nav)
- Hide remaining wm components that are exposed now that all the
  features are in the Shell

Bug: 169894807
Test: atest WMShellUnitTests WMShellTest
Test: Verify Pip/Split/One handed still behaves as expected
Change-Id: If0f50f6b701ac4b013a9e41fe6f88857ea35bf5b
2020-11-06 16:13:03 -08:00
jorgegil@google.com
2dd597ae41 Fix resizability in apps using the override min size
Fixes an issue where activities using the manifest min
width/height was causing them to not be resizable.
This was caused by:
1. transformBoundsToMinimalSize is called on drag resize, which
causes the bounds to go back to the minimal size.
2. After fixing 1, drag resizes "jumps" from the minimal size to
the default bounds because the normal bounds are not set to the
minimal size
3. Reentry bounds are not restored correctly because when
calculating the destination bounds, the bounds where always
transformed to the minimal size at the end.

This CL changes a few things to fix these issues:
1. The minimal size is now considered when calculating the
entry bounds or transforming bounds to aspect ratio. This means
that instead of calculating the bounds/size using the "default"
size and then adjusting to the minimal size, we'll look at
whether we should calculate using the default or the minimal size
from the very beginning.
2. When the minimal size changes (onTaskAppeared, onTaskInfoChange,
swipeToHome), the normal bounds and movement bounds need to be
recalculated. The normal bounds are the default bounds, and the
default size changes if the minimal size is set or unset.
3. The min edge size used to be set by PipTouchHandler depending
on whether PIP is expanded to either expandedMinEdgeSize or 0. It
is now set to mDefaultMinEdgeSize if not expanded. This was not
causing issues before but it started to with these changes.

Also moved the minEdgeSize and overrideMinSize to PipBoundsState
as part of b/169373982

Fixes: 172598623
Bug: 169373982
Test: com.android.wm.shell.pip
Test: enter pip, expand, resize, reentry bounds,
minimal size in manifest, aspect ratio change all work
correctly.

Change-Id: I4baa46eb641323282fc23fd4499365c83ff38a7d
2020-11-06 16:13:03 -08:00
TreeHugger Robot
445e62382c Merge "Test PipNotification when there is a MediaSession" 2020-11-06 19:38:59 +00:00
Ben Lin
5ad6ca668d Merge "Move attach/detach PiP menu calls to onTaskAppear/Vanish." 2020-11-06 19:07:15 +00:00