Commit Graph

1353 Commits

Author SHA1 Message Date
Bill Lin
5ad4a8093c Merge "Redesign One-haned tutorial UX behavior" into sc-dev 2021-07-10 01:05:11 +00:00
Bill Lin
1334cfb90d Merge "Improve SystemUIBootiming_StartServices_avg" into sc-dev 2021-07-10 01:03:56 +00:00
Bill Lin
80b340a9aa Improve SystemUIBootiming_StartServices_avg
Previously, we tried to tuning boottime of SysUI
See go/systemuiboottiming_ohm
- Reduce access setting provide at SysUI start-up
- Remove unused obervers
  1. Timeout
  2. TapAppExit
- Update mShortcutEnabled state at ctor

Test: manual enable OHM shortcut, rebot
      make sure shortcut function works
Test: atest WMShellUnitTests
Test: asit/perf/boottime_test
Bug: 193225130
Change-Id: I2753f8b1e47622c00b9c6d2f4cd319c6e43634ea
2021-07-09 21:31:05 +08:00
Bill Lin
477c88a7d5 Redesign One-haned tutorial UX behavior
- Always show tutorial for user to know device state
  is in One-handed mode.
- Clean the redundant params from ctor

Test: manual trigger OHM
Test: atest WMShellUnitTests
Bug: 192648901
Change-Id: I10c3f3f29190b672fb88471df3cf374a994cdaa7
2021-07-09 19:05:05 +08:00
Jason Chang
97b75f09ed Add metrics log for One-handed mode Shortcut toggle switch
To write metrics log for One-handed mode Shortcut toggle switch state.

Bug: 192641587

Test: Local add logs to verify before writing metrics logs API call
Test: atest SystemUITests
Test: atest WMShellTests
Change-Id: I02fda724bf2960355d78f1a26ac6d65225687176
2021-07-09 03:24:58 +00:00
Bill Lin
7f162ddaf0 Merge "Improve SystemUIBootTiming performance in OneHandedController" into sc-dev 2021-07-09 02:00:33 +00:00
Chris Li
a23a2bb5db Revert "Revert "Not show size compat UI when task is not visible""
This reverts commit 76370b6fe6.

Reason for revert: Fix the merge break in ShellTaskOrganizerTests.java

Fix: 193069342
Test: atest WMShellUnitTests:ShellTaskOrganizerTests
Change-Id: I02c4bddc407eaac0ebb7cd5abb0b394f242d4d6e
2021-07-08 12:09:40 -07:00
Chris Li
e7ed99bfc2 Merge "Remove TaskInfo#topActivityToken usage in size compat for security" into sc-dev 2021-07-08 18:05:40 +00:00
Leon Jeng
76370b6fe6 Revert "Not show size compat UI when task is not visible"
This reverts commit adb92508c0.

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=git_master&target=coral-userdebug&lkgb=7530814&lkbb=7530923&fkbb=7530923, bug b/193105445

Bug: 193105445
Change-Id: I697229da6986d6466d7f13872e9ae7a727b80838
2021-07-08 09:48:10 +00:00
Bill Lin
3aafe19994 Improve SystemUIBootTiming performance in OneHandedController
Fix race condition in SystemUIBootTiming issue.

1. Avoid updateOneHandedEnabled() called twice during init
   a. [O] come from setOneHandedEnabled()
   b. [X] come from setSwipeToNotificationEnabled()
2. Passively waiting shortcut enabled changed callback, and then
         query setting ACCESSIBILITY_BUTTON_TARGETS status.
3. Add a new flag isShortcutEnabled to cache shortcut enabled
   state.
4. By new OHM Settings UX design setSwipeToNotificationEnabled()
   should NOT setEnabledGesturalOverlay().
5. Remove redundant auto enabled Toast and print in log instead.
   (In general case, user is not able to see the Toast)

Test: atest google/perf/boottime/boottime-test
Test: atest SystemUITests
Test: atest WMShellTests
Test: manual factory reboot, OHM should disabled by default
Bug: 192612924
Change-Id: I8b24c99bc8bd5bfb17c73a6bb8494109d9a8170d
2021-07-08 14:14:25 +08:00
Chris Li
927c644bfa Merge "Not show size compat UI when task is not visible" into sc-dev 2021-07-08 05:53:15 +00:00
Chris Li
1245aefa49 Remove TaskInfo#topActivityToken usage in size compat for security
Security report shows that this can cause leak token of different app.

Replace the functionality with a callback to the TaskOrganizerController
to restart activity when size compat restart button is clicked.

Bug: 186776724
Test: manually verify the restart button still works
Change-Id: I097b9f02e8435e6765695b9d5a531a4e165bac66
Merged-In: I097b9f02e8435e6765695b9d5a531a4e165bac66
2021-07-07 21:09:24 -07:00
Chris Li
adb92508c0 Not show size compat UI when task is not visible
Before, when a size compat task was hidden, the size compat UI might
still be showing. Now, remove the UI when the task is no longer visible.

Bug: 193069342
Test: manually verify the size compat button is not showing in recents
Change-Id: Ia17a97f5e7a9af497d8da16b31bb5169dd502d53
2021-07-07 17:46:08 -07:00
Ben Lin
c701a4c904 Merge "PiP: Update accessibility window as menu shows/hides." into sc-dev 2021-07-08 00:01:25 +00:00
Ben Lin
d48bec9beb PiP: Update accessibility window as menu shows/hides.
When calculcating accessibility regions w/ shell root, currently since
shell root has no information on the child views' alpha, visibility,
etc, it is always detected as active by the a11y controller. Update the
accessibility region for PIP as menu shows and hides so that the
controller can take this into consideration.

Bug: 192524653
Test: Switch access to PIP when menu shows - able to navigate around
menu items. Switch Access to PIP when menu is gone - able to select PIP
itself.

Change-Id: I7d5649ecbf98751a117c58ac8127584bc3196910
2021-07-07 12:25:00 -07:00
Bill Yi
71be08107c Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I9120bcce06036ec258aea077d3e60134b7a2c1d1
2021-07-07 13:40:10 +00:00
Wei Sheng Shih
f8a49bec00 Merge "Prevent apply system insets on splash screen from FITS_SYSTEM_WINDOWS" into sc-dev 2021-07-07 11:11:03 +00:00
wilsonshih
d5957a4735 Prevent apply system insets on splash screen from FITS_SYSTEM_WINDOWS
Similar to b/191339594, the context from application contains
View_fitsSystemWindows attributes, thus apply system insets to the
root FrameLayout.

Fixes: 192404431
Test: manual launch several apps from Launcher/Notification.
Tets: atest SplashscreenTests
Change-Id: I4746550de5e2a35ec364e09b631e87b41556a8b9
2021-07-07 11:28:30 +08:00
Vadim Caen
2be72d030b Merge "Implement the legacy splash screen behavior" into sc-dev 2021-07-05 15:35:01 +00:00
TreeHugger Robot
03b61d22b6 Merge "Fix NPE in TvPipController" into sc-dev 2021-07-02 22:25:09 +00:00
Yohei Yukawa
9dde701446 Switch back to sync IInputMethodManager
This CL logically reverts recent CLs [1][2][3][4][5][6][7][8][9] to
switch back to the previous sync IPC approach in IInputMethodManager
except for the following two IPCs.

 * reportPerceptibleAsync
 * removeImeSurfaceFromWindowAsync

Reason for revert:
We need more time to understand its performance implications.

 [1]: If4b40244a2e0e3b11c38c1da9340ba8e5166ad64
      b9590fa1e1
 [2]: If79e063641a01b325c63eb9f871f5b992d7c0b72
      5a5648dcb5
 [3]: I1547b98b2aacf764e33aadc9ab784f2013f58f2f
      d833f0dab4
 [4]: I646ef4ae0570aae1812ea267f309441fdec6938d
      38fd020616
 [5]: Iaa63e01453da4ff0e3f446eac036b3be3180cb73
      4a820ccc41
 [6]: Id516fd1c961f43ac3e139c88d7ed004c188d458b
      0a32fd21ef
 [7]: Icb396ae5d74060af69c4ecb16723b2e37b9f2067
      c4663ba6a9
 [8]: I3eafbc28ed3acf3ba859885bf201cb06b3149b94
      f226a79fee
 [9]: Ic584203c1221fbae17f5e2d8f09e3992df061646
      5e2d9f271d

Bug: 163453493
Bug: 174892351
Fix: 190486491
Test: atest CtsInputMethodTestCases
Change-Id: If16ac0de536d9089eb04f6e07b1ee47378124658
Merged-In: If16ac0de536d9089eb04f6e07b1ee47378124658
2021-07-02 07:06:07 +00:00
Vadim Caen
f08dae3158 Implement the legacy splash screen behavior
For apps opted out of the new splash screen, we show the full background
drawable.
Ensure there has send the splash screen background color to
StartingWindowListener.

Bug: 182880656
Test: manual set useLegacy to true then verify legacy splash screen.
Test: atest WmTests:ActivityRecordTests
Test: atest StartingSurfaceDrawerTests

Change-Id: Icf662f3c5f368f447e718f82f78dc25b909ca9be
2021-07-01 15:05:06 +08:00
Hongwei Wang
395c582b62 Merge "PiP: Move tap-outside-hide block one level higher." into sc-dev 2021-07-01 04:31:08 +00:00
TreeHugger Robot
5a43b726d4 Merge "Restore split layout when wm-shell no longer controlling IME" into sc-dev 2021-07-01 00:48:07 +00:00
Ben Lin
67760d21fd PiP: Move tap-outside-hide block one level higher.
This used to be only check for drag resize case, but now that it is
disabled, this is no longer called. Move it at a higher call block so
that it is also checked for pinch resizing case.

Bug: 191529856
Test: Tap outside PIP when menu is showing, it hides
Change-Id: I810a0825a96224b395dde7d51df077fed996c3ff
Merged-In: I810a0825a96224b395dde7d51df077fed996c3ff
(cherry picked from commit 3892e8e09f)
2021-06-30 22:03:26 +00:00
TreeHugger Robot
55d4b08c43 Merge "Import translations. DO NOT MERGE ANYWHERE" into sc-dev 2021-06-30 20:43:10 +00:00
Bill Yi
87b485f2dd Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: Ia1e7179f98a762a7f4ea8cfc3cc6cd17e9e97072
2021-06-30 18:13:21 +00:00
Jacqueline Bronger
a205547d8b Fix NPE in TvPipController
Test: atest android.accessibilityservice.cts.AccessibilityWindowReportingTest#putWindowInPictureInPicture_generatesEventAndReportsProperty
Bug: 189418438
Change-Id: I28e5eb78dcade1c83ee53ed88bee84834e618615
2021-06-30 14:38:36 +00:00
Jorge Gil
c794661b9a Merge "Cancel ongoing PIP animations in onTaskVanished" into sc-dev 2021-06-30 14:27:18 +00:00
Jorge Gil
47aa9f156e Merge "Check the min menu size when exp. to normal bounds" into sc-dev 2021-06-30 03:32:16 +00:00
Jerry Chang
80a068e144 Restore split layout when wm-shell no longer controlling IME
Add a callback in ImePositionProcessor to notify IME cotnrol target
changed. And make sure to restore the split layout when wm-shell is not
contorlling IME insets anymore.

Fix: 174119991
Test: 1. open IME on the bootom split to adjust split layout with IME
      2. focus on direct reply of open passwork keyguard
      3. observe the split layout been restored after back to split

Change-Id: I5caeeff9406d21e21c8a82c0078cbfae36bd4063
Merged-In: I5caeeff9406d21e21c8a82c0078cbfae36bd4063
2021-06-30 09:09:06 +08:00
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
4f25b8822e Merge "Apply the mask to all splashscreen forground icons" into sc-dev 2021-06-29 16:52: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
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
e606dcbecb Merge "Check shortcut enabled before auto trun on OHM" into sc-dev 2021-06-28 07:34:47 +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
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
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
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
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