Commit Graph

1477 Commits

Author SHA1 Message Date
jorgegil@google.com
129493d418 Cancel ongoing PIP animations in onTaskVanished
onTaskVanished may be called when an activity is moved to
the back while a resize animation is still in progress.
This causes a race between the windowing mode change to
fullscreen and the PIP resize that results in the
fullscreen task leash getting a PIP-sized crop.
This change cancels any ongoing animations in
onTaskVanished and makes sure that finishResize() is not
called when the animation is canceled because the transition
to fullscreen will handle the final resize and cropping.

Bug: 188856244
Test: enter YT PIP, click the next button and the music
button quickly after that, then re-open YT from the
notification - verify the activity is fullscreen and is
cropped correctly.

Change-Id: Ide52b8c6b63205081bde96472a5e0589664e1c8a
2021-06-29 17:33:42 -07:00
jorgegil@google.com
dcb5e60c38 Check the min menu size when exp. to normal bounds
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
2021-06-29 10:39:00 -07:00
Vadim Caen
6ed19f1960 Merge "Apply the mask to all splashscreen forground icons" into sc-dev am: 4f25b8822e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15054861

Change-Id: I6842be5d52809a8a73cdde721a3ef0c8fbe1d754
2021-06-29 17:03:01 +00:00
Vadim Caen
4f25b8822e Merge "Apply the mask to all splashscreen forground icons" into sc-dev 2021-06-29 16:52:57 +00:00
Tony Huang
ee5d20f8fe Merge "Always using middle position to resize layout" into sc-dev am: 1591096aed
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15127130

Change-Id: Ia1c40b4bd80788d8a318b69c79c3fdfa3998a0e2
2021-06-29 06:12:57 +00:00
Tony Huang
1591096aed Merge "Always using middle position to resize layout" into sc-dev 2021-06-29 05:57:53 +00:00
Tony Huang
ad813d0c45 Always using middle position to resize layout
After rotation, the divider should always in middle if not in
minimized mode, so it should use middle position rather than
divider current position to resize split on rotation callback.

Fix: 192219057
Test: manual
Test: atest WMShellUnitTests
Change-Id: I255c1d6aad9a796ca3ec722f45977eb360fe3805
2021-06-29 05:48:50 +00:00
Jerry Chang
7f233ab601 Merge "Fix caching IME status for split screen even when it is not activated" into sc-dev am: 5ded797ef4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15080852

Change-Id: I8e8c2ab64abd6fe9dd3c3d591e369c43de4f6169
2021-06-29 04:27:21 +00:00
Jerry Chang
5ded797ef4 Merge "Fix caching IME status for split screen even when it is not activated" into sc-dev 2021-06-29 04:16:19 +00:00
Bill Yi
cdecd1f4c3 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I8a7847a617bc2ccedde00920dd1a4d3d5b0a2753
2021-06-28 18:41:30 +00:00
Bill Lin
b9ba96e566 Merge "Check shortcut enabled before auto trun on OHM" into sc-dev am: e606dcbecb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15102775

Change-Id: Ibca64c3edb714161b6500e334eef853899f6e737
2021-06-28 07:40:28 +00:00
Bill Lin
e606dcbecb Merge "Check shortcut enabled before auto trun on OHM" into sc-dev 2021-06-28 07:34:47 +00:00
Shawn Lin
3582b491fd Merge "Updating the display bounds when it changes" into sc-dev am: 117ff31a3e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15073695

Change-Id: I7fd8c7840f00927dd093fb6dbbcd4f8e348c427e
2021-06-28 07:04:27 +00:00
Shawn Lin
117ff31a3e Merge "Updating the display bounds when it changes" into sc-dev 2021-06-28 07:00:09 +00:00
Bill Lin
6061ddc2f7 Check shortcut enabled before auto trun on OHM
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
2021-06-28 08:30:01 +08:00
Ming-Shin Lu
d30eff1264 Merge "Waiting a proper time to remove the snapshot starting window" into sc-dev am: 87d84d5e23
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14957147

Change-Id: I2b02f5b5f009825058b34e3a23b41db653f7c583
2021-06-25 12:36:13 +00:00
Ming-Shin Lu
87d84d5e23 Merge "Waiting a proper time to remove the snapshot starting window" into sc-dev 2021-06-25 12:24:49 +00:00
Jerry Chang
64b1cdcbcf Fix caching IME status for split screen even when it is not activated
Add back the divider bar view's visibility checks which was removed by
ag/14318188 in order to prevent caching IME status while the split is
not activated.

Fix: 188807172
Test: lock and unlock the device with password keyguard while split
activated, observed the split divider handler is visible.
Test: rotate the device while showing IME, then dock two apps to enter
split mode, observed the split divider handler is visible.

Change-Id: Iaa4a68f98bab6a832f4b2cbd448cb42b1ecb9bbb
2021-06-25 12:07:40 +08:00
Jason Chang
0f20d6ebad Merge "Migrate metrics logs to reflect new One-handed UI changes in Settings" into sc-dev am: 33f1797e56
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15026540

Change-Id: I01035cf71e17b3d0a7edd9de9a4d597df9ba8db2
2021-06-25 03:30:44 +00:00
Jason Chang
33f1797e56 Merge "Migrate metrics logs to reflect new One-handed UI changes in Settings" into sc-dev 2021-06-25 03:28:43 +00:00
Ming-Shin Lu
7e9bd7fe7c Waiting a proper time to remove the snapshot starting window
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
2021-06-25 02:00:56 +00:00
Tiger Huang
1d0f287cf3 Merge "Release leashes of insets controls if they are not needed" into sc-dev am: ef1bb2c9fa
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15090014

Change-Id: I4320a6ba1a88c9e5bcfd49ab56b13c90835a8cb6
2021-06-24 15:26:22 +00:00
Tiger Huang
ef1bb2c9fa Merge "Release leashes of insets controls if they are not needed" into sc-dev 2021-06-24 15:11:04 +00:00
Jason Chang
1d17d4b91d Migrate metrics logs to reflect new One-handed UI changes in Settings
1. Add metrics logs for EVENT_ONE_HANDED_TRIGGER_ROTATION_OUT.
2. Add metrics logs for Show notification toggle settings changes.

Bug: 191730790

Test: manual
Test: atest WMShellUnitTests
Change-Id: I04ba806af1e427756b61f36279be4fff78dca900
2021-06-24 22:24:55 +08:00
Wei Sheng Shih
944045a0d9 Merge "Clear padding and background after create view from context." into sc-dev am: f2d2fb5292
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15026547

Change-Id: I549b530775022a4445f56d83f43274676c4dea74
2021-06-24 11:06:15 +00:00
Tiger Huang
c7746aa3de Release leashes of insets controls if they are not needed
Previously, leashes would be only released by GC in some cases, but the
timing could be late. This CL proactively release them as long as they
are not needed. The cases were:

1. The leashes in DisplayImeController. It didn't release leashes while
   receiving a new one.

2. The leashes returned from addWindow/relayoutWindow. The leashes would
   be copied to prevent others from releasing them before writeToParcel.
   The copied leashes could be redundant after writeToParcel.

3. The leashes held by the client whose window is removed. If a window
   is removed, the server won't invoke mClient.insetsControlChanged, so
   the client would never get notified about losing control to release
   the leashes. This could happen if the window doesn't have an exiting
   animation.

Fix: 175851610
Test: Steps in the bug.
Test: Show and dismiss a dialog which doesn't have FLAG_ALT_FOCUSABLE_IM
      or any window animation. Repeat this thousands of times. And see
      if there are many insets leashes as offscreen layers in `dumpsys
      SurfaceFlinger`
Change-Id: I5eb774ac071154a8d7205dbd1ab4a5f8eca215c3
2021-06-24 09:42:32 +00:00
shawnlin
a8f0672b9a Updating the display bounds when it changes
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
2021-06-24 15:03:34 +08:00
wilsonshih
0797c86219 Clear padding and background after create view from context.
When create view with Context, there will also load some view
attributes from the Context and pre-set to the View object, to ensure
the splash screen view not affected by those attributes, clear padding
and background after create those view objects.

Bug: 191339594
Test: manual launch several apps from Launcher/Notification.
Tets: atest SplashscreenTests
Change-Id: I05be9c296a04cd49a0896ad8aef57643720d60ce
2021-06-24 11:10:07 +08:00
Mady Mellor
bbf7a1fc66 Merge "Add a note about keeping a dimension value in sync with CTS" into sc-dev am: f46a8f6276
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15080681

Change-Id: I8bebf3091a99d29fc63780fcf76eae5e5419866a
2021-06-23 20:58:39 +00:00
Mady Mellor
ab00abc6f6 Add a note about keeping a dimension value in sync with CTS
Test: treehugger
Bug: 182934996
Change-Id: Ib8dd9bc9d13d9f5a737ceb0d61e34b825f883f8c
2021-06-23 11:04:27 -07:00
Vadim Caen
b83f4423f8 Apply the mask to all splashscreen forground icons
- Ensure the all icons including AVD are masked using the system mask
 - Scale up the AVD if no background is set in the splash screen API

 Also:
 - Use the iconview size to check whether the icon should be faded out

Bug: 182883560
Test: Manually with oversized AVD, and setting a background under the
AVD

Change-Id: I69e38b35f71d0bb21d3e591c3eb37a3088ad48db
2021-06-23 15:01:17 +02:00
Wei Sheng Shih
f7c1fe3a52 Merge "Ignore exit animation when view is detached from window." into sc-dev am: a1b3ce5250
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14972767

Change-Id: Ia4fe106cf863eb27aa991e00f9bad9ae1da12b08
2021-06-22 11:15:13 +00:00
Wei Sheng Shih
a1b3ce5250 Merge "Ignore exit animation when view is detached from window." into sc-dev 2021-06-22 11:02:59 +00:00
TreeHugger Robot
b87a8e27fd Merge "Fix SysUI NPE crash during the boot/init progress" into sc-dev am: 2adcf7686d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15052835

Change-Id: Ic5343112b5bf98646eb96a8839c487b04b348519
2021-06-22 07:41:24 +00:00
TreeHugger Robot
2adcf7686d Merge "Fix SysUI NPE crash during the boot/init progress" into sc-dev 2021-06-22 07:27:24 +00:00
Bill Lin
c4bdf37af2 Fix SysUI NPE crash during the boot/init progress
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
2021-06-22 11:50:46 +08:00
TreeHugger Robot
9c2c1fac7a Merge "Hook WakefulnessLifecycle for best timing of LockedDisabled" into sc-dev am: aadedc76b6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15002670

Change-Id: I1d7ab43a93e9afdf20baf819a1e962d0513991b0
2021-06-21 19:54:31 +00:00
TreeHugger Robot
aadedc76b6 Merge "Hook WakefulnessLifecycle for best timing of LockedDisabled" into sc-dev 2021-06-21 16:42:36 +00:00
wilsonshih
84837512a1 Ignore exit animation when view is detached from window.
After first launched activity start remove starting window, there start
a second activity with a new task, so there will trigger a open/close
task transition while playing starting window exit animation, but since
the first launched activity is going to destory, there will goes to
clear all window for that activity.
For client side we can ignore the animation after it was detached from
window.

Bug: 190040281
Test: manual
Change-Id: Idd939feb72163d585e14db480b1e374e41597928
2021-06-21 09:37:23 +08:00
TreeHugger Robot
913171d5f0 Merge "Do not skip onMovementBoundsChanged if already in PiP" into sc-dev am: 99bded1612
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14983324

Change-Id: I07e7e0527bb13ea35bb927bdc76399297a7f24c6
2021-06-20 20:32:09 +00:00
TreeHugger Robot
99bded1612 Merge "Do not skip onMovementBoundsChanged if already in PiP" into sc-dev 2021-06-20 20:18:16 +00:00
TreeHugger Robot
1b1d2d5d10 Merge "Removing remaining references of ActivityView in fw/base" into sc-dev am: dc86e26f54
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14829810

Change-Id: Id373b53b241f52510c070749976822a1cf886e01
2021-06-19 01:38:01 +00:00
TreeHugger Robot
dc86e26f54 Merge "Removing remaining references of ActivityView in fw/base" into sc-dev 2021-06-19 01:23:12 +00:00
Hongwei Wang
330fc27924 Do not skip onMovementBoundsChanged if already in PiP
If the Task is already in PiP mode and fixed rotation is happening, we
still need the onMovementBoundsChanged callback to go through in
PipTaskOrganizer.

Note that there seems to be an existing bug that Launcher shelf height
is ignored with the following steps
- Enter PiP and open another app to fullscreen
- Rotate screen and swipe the other app to home

Video: http://recall/-/aaaaaabFQoRHlzixHdtY/gs08EEyHyNcn86lsIcbIRe
Bug: 191143521
Test: follow the reproduce steps in bug, see the video
Merged-In: I601c7493794316883445e9c69e5cdd6a808e8933
Change-Id: I601c7493794316883445e9c69e5cdd6a808e8933
2021-06-18 22:34:07 +00:00
Winson Chung
542830c839 Merge "Add cached state to prevent blocking calls from SysUI->Shell" into sc-dev am: 979fe90f43
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14964835

Change-Id: I526730dd7183ae1b7f5314e77910a1474441e58f
2021-06-18 21:52:34 +00:00
Winson Chung
979fe90f43 Merge "Add cached state to prevent blocking calls from SysUI->Shell" into sc-dev 2021-06-18 21:34:29 +00:00
TreeHugger Robot
01a4b9b237 Merge "Fix shortcut rotate trigger swipe notification" into sc-dev am: bd1d84122b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15017733

Change-Id: Ic90e3d27fcc267a62bdb6a79da77d8e681f0f5a5
2021-06-18 17:22:59 +00:00
TreeHugger Robot
bd1d84122b Merge "Fix shortcut rotate trigger swipe notification" into sc-dev 2021-06-18 17:12:22 +00:00
Bill Lin
638db506c8 Fix shortcut rotate trigger swipe notification
onActivatedActionChanged() was invoke When setting
ONE_HANDED_MODE_ACTIVATED update, the root cause is
onRotateDisplay() in OHMDisplayAreaOrganizer and go
to finishOffset() and callback onStopFinished(), then
OHMController#onStopFinished() invoke reset settings
through notifyShortcutState(STATE_NONE) which reset
settings key ONE_HANDED_MODE_ACTIVATED to 0.
At the meanwhile reset key cause observer invoke
onActivatedActionChanged() to expand notification again.

The simple solution is directly return if current setting
is "Swipe notification" in OHMDisplayAreaOrganzier
onRotateDisplay() to avoid finishOffset() called.

Test: manual tap OHM shortcut to expand notification,
      rotate to check if notification expanded
Test: atest WMShellUnitTests
Bug: 191337996
Change-Id: I697dbabce070249f0a5e513abd514f9e02b8aa16
2021-06-18 21:05:44 +08:00
Ben Lin
30fc7ff9c9 Merge "PiP: Update menu bounds before showing the menu." into sc-dev am: 9b8c01844b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15001386

Change-Id: I784a90cb3c34da81ec5840a0b3996c24c7ca0d32
2021-06-17 23:30:38 +00:00