Commit Graph

1530 Commits

Author SHA1 Message Date
Ming-Shin Lu
2bc28752af RESTRICT AUTOMERGE: More improve IME transition during task switch am: 278e944fd5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15746913

Change-Id: If6e2b58d76cbcbb1b4721f9bffca157cfccc9cf4
2021-09-15 14:54:59 +00:00
Ming-Shin Lu
278e944fd5 RESTRICT AUTOMERGE: 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]: I7865e17b57961e12a0cdcf068e412195123a6ec7

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:01:56 +08:00
TreeHugger Robot
abeb3d924a Merge "Fix one more import for ContextThemeWrapper." into sc-qpr1-dev am: 1bc5c4fe62
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15713462

Change-Id: I2bcdd0beb16d12bc21506bba1a7354f82b8a152c
2021-08-31 12:14:19 +00:00
TreeHugger Robot
1bc5c4fe62 Merge "Fix one more import for ContextThemeWrapper." into sc-qpr1-dev 2021-08-31 11:56:52 +00:00
TreeHugger Robot
04cfc450b7 Merge "Fix broken launcher build to use the right import for ContextThemeWrapper." into sc-qpr1-dev am: 2ae305234d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15713463

Change-Id: If550ccfc90fe6d24f116c011765e8eb99a6db6af
2021-08-30 17:02:01 +00:00
Becky Qiu
40be02e521 Fix broken launcher build to use the right import for ContextThemeWrapper.
Bug: 195028385
Test: can build now.
Change-Id: Ia36b77e3274191efa28c87cc0b2604a66906b604
Merged-In: Ia36b77e3274191efa28c87cc0b2604a66906b604
(cherry picked from commit 2ee44db719)
2021-08-30 06:10:03 +00:00
Winson Chung
58b9ad0d37 Fix one more import for ContextThemeWrapper.
Bug: 195028385
Test: can build now.
Change-Id: Ie14285b614318a99098f4457d7564a25724cde6b
Merged-In: Ie14285b614318a99098f4457d7564a25724cde6b
(cherry picked from commit fff8e21975)
2021-08-30 06:09:22 +00:00
Chris Li
3553846969 Merge "Fix race condition on size compat UI" into sc-qpr1-dev am: f9c3101df3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15614097

Change-Id: Icf6c77c284a383748f8bdc0c66bb306b2937d3a3
2021-08-18 23:47:53 +00:00
Chris Li
6104af0e8c Fix race condition on size compat UI
Before, the leash might have been released while the update surface
position runnable was in queue. Now, we make sure the leash is valid
before update position.

Fix: 196942784
Test: manual
Change-Id: I2d052bf46b12a2441dbc0aa1aabf5dfe9be2fa45
2021-08-18 17:40:12 +00:00
Selim Cinek
46c86140d0 Merge "Don't create one-handed-background-panel after rotation" into sc-dev am: ab89e910bc am: 557189cf28
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15537318

Change-Id: Ic37b7620ab3e3883d0ba150c8e2c40780fc592a7
2021-08-16 12:01:17 +00:00
Selim Cinek
193406410a Merge "Don't create one-handed-background-panel after rotation" into sc-dev am: ab89e910bc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15537318

Change-Id: I772cb9e60857aebda21a11083ed2bc2690a1517c
2021-08-16 11:52:16 +00:00
Selim Cinek
557189cf28 Merge "Don't create one-handed-background-panel after rotation" into sc-dev am: ab89e910bc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15537318

Change-Id: I5f992e78160d4ba8e71264033efdb474d22e2f87
2021-08-16 11:51:22 +00:00
Mady Mellor
05e85158da Merge "[QPR1] Fix dismiss not working in landscape" into sc-qpr1-dev am: e64c264c04
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15521525

Change-Id: I0796b9a061b15b9a989f34282cb5bcaed466d8cd
2021-08-12 15:16: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
Mady Mellor
8f71a21677 [QPR1] Fix dismiss not working in landscape
In stack animation controller only one target would ever
be added so when the target is re-created after rotating
then it wouldn't be used.

Test: - have some bubbles, drag them around, rotate device, try to
        dismiss them => they can be dismissed in landscape
      - get more bubbles, rotate back to portrait, try to dismiss
        them => they can be dismissed in portrait
      - drag the stack around the edges of the screen and verify that
        the only magnetic spot is where the dismiss target is
Fixes: 193008696
Change-Id: I6b24b1f9d301d37749dc67c95392fd6c8451df00
Merged-In: I6b24b1f9d301d37749dc67c95392fd6c8451df00
2021-08-10 21:53:59 +00:00
Jason Chang
7bf628ff7c Merge "Fix one-handed mode tap app to exit doesn't work in factory boot" into sc-dev am: 20c38783c2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15472778

Change-Id: Ia1c142195635b51b006a0773ab628291f03b2dc7
2021-08-06 05:48:10 +00:00
Jason Chang
20c38783c2 Merge "Fix one-handed mode tap app to exit doesn't work in factory boot" into sc-dev 2021-08-06 05:36:49 +00:00
Jason Chang
413ab9d586 Fix one-handed mode tap app to exit doesn't work in factory boot
Root cause:
1. Design change "tap app to exit" -> always being true, and settings
remove this option.
2. Tuning performance, due to 1, no longer listens to the key change,
so we remove the listener.

Solution:
Change getSettingsTapsAppToExit() API to return default TRUE.

Bug: 195629000
Test: Build ROM and factory-reset to test
Test: atest WMShellUnitTests
Change-Id: Id3c265258ed28f7e0aa54505c339671885d28fa7
2021-08-06 01:53:39 +00:00
Bill Yi
ee8f81d6b4 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I682d240e086e7ea706c7a513b84e6e0e872b2365
2021-08-04 10:09:24 +00:00
Jason Chang
63f15d32dd 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: I55abb1baa725c312038fb454f9a3737d88c13fe7
2021-07-27 16:12:56 +00: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
Vadim Caen
733a7c94c5 Merge "Do not draw icon background if it shouldn't be seen" into sc-dev am: ee08a68fd4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15175437

Change-Id: Icb38e71a17f5b143545622411a690ff8b2985638
2021-07-27 10:20:07 +00:00
Vadim Caen
ee08a68fd4 Merge "Do not draw icon background if it shouldn't be seen" into sc-dev 2021-07-27 10:05:17 +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
TreeHugger Robot
4422d05a6a Merge "Import translations. DO NOT MERGE ANYWHERE" into sc-dev 2021-07-23 22:42:14 +00:00
Wei Sheng Shih
b793b6c9b8 Merge "Fine tune splash screen icon generation algorithm" into sc-dev am: e2ff050fbb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15283495

Change-Id: Ica8dc3566cdd82ebc7c39e4dc84e812589ed7ebb
2021-07-23 13:47:25 +00:00
Bill Yi
3c9f786cfe Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I326b034f3bacb172f66f1c2ddd76bb9f359bcfe5
2021-07-23 13:33:10 +00:00
Wei Sheng Shih
e2ff050fbb Merge "Fine tune splash screen icon generation algorithm" into sc-dev 2021-07-23 13:31:27 +00:00
Wei Sheng Shih
cda4fc034e 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: Idcbb4bb2347d12d2083fb6b0e6a4a0d1f7736de3
2021-07-23 12:08:23 +00:00
Wei Sheng Shih
0793f65c95 Merge "Correcting the package name used on splash screen window." into sc-dev 2021-07-23 11:54:28 +00:00
Vadim Caen
496b4cbb86 Do not draw icon background if it shouldn't be seen
Test: atest CtsWindowManagerDeviceTestCases:SplashscreenTests
Bug: 193608336
Change-Id: I824137e67eaa0133337fcaf55c44fca46bac8010
2021-07-23 13:27:11 +02: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
wilsonshih
331615ad61 Fine tune splash screen icon generation algorithm
Filter out the translucent pixels when compute the foreground colors
of an adaptive icon, which should make sense because the translucent
pixels on icon should only used for decoration, do not let it affect
the opaque pixels, also with this filter we won't drop down the
performance when using palette.

Bug: 193304878
Test: manual launch single color background apps.
Change-Id: Ia9873cf907d30bb7f30318a289a54159d0a51ee3
2021-07-23 12:44:43 +08:00
TreeHugger Robot
c942d2fb69 Merge "Skip operation on content overlay if task's vanished" into sc-dev am: 5cac66cb4e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15353756

Change-Id: Ib7ec12471d9aab62828471967baab803ea9c0b04
2021-07-22 23:33:40 +00:00
TreeHugger Robot
5cac66cb4e Merge "Skip operation on content overlay if task's vanished" into sc-dev 2021-07-22 23:20:20 +00:00
Winson Chung
36fe682d24 Merge "Skip animating out bubble screenshot if surface is not ready" into sc-dev am: d4dd12ee06
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15352585

Change-Id: I17f146a6fd4e81b24b8540adb90009ce5fce40ef
2021-07-22 22:29:45 +00:00
Winson Chung
d4dd12ee06 Merge "Skip animating out bubble screenshot if surface is not ready" into sc-dev 2021-07-22 22:10:46 +00:00
Hongwei Wang
1817bc47bd Skip operation on content overlay if task's vanished
The stack trace in b/194344478 and b/194280568 is actually from the
preceding ActivityThreadTest test, which does not fail but does crash
certain test cases after that.

Since we may set a start delay on the content overlay fading out
animation, there is chance that onTaskVanished happens before it is
actually started. It's also possible that onTaskVanished happens during
the content overlay fadeout. This CL should have addressed both cases.

Bug: 194344478
Bug: 194280568
Test: atest --iteration 5 \
      ActivityThreadTest#testHandlePictureInPictureRequested_overriddenToEnter \
      ScreenshotTests#testScreenshotSecureLayers \
      TaskStackChangedListenerTest#testTaskChangeCallBacks
Change-Id: I81c0622966df32e02db7cb5aa3cd42d7c4af735e
Merged-In: I81c0622966df32e02db7cb5aa3cd42d7c4af735e
2021-07-22 21:38:57 +00:00
TreeHugger Robot
6043cd6908 Merge "Apply theme color and fade-in transition effect at the top of One-handed mode" into sc-dev am: a08d1cb0f1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15234619

Change-Id: I0ec888e0bcbe99a6a666920ea2455e01372a2d3a
2021-07-22 20:31:41 +00:00
TreeHugger Robot
a08d1cb0f1 Merge "Apply theme color and fade-in transition effect at the top of One-handed mode" into sc-dev 2021-07-22 20:09:53 +00:00
Jason Chang
966382b0c9 Apply theme color and fade-in transition effect at
the top of One-handed mode

1. Implement the Dynamic color theme at the top Tutorial area
but the color should not be the same as the recents UI.

2. Do not translate Tutorial icon & text vertically, then provide
quick subtle fade-in effect for Tutorial window.

3. Apply new icon for tutorial.

Bug: 193126258
Bug: 193589897

Test: Local verify when changing dark theme and wallpaper theme.
Test: Local verify Tutorial icon & text fade-in effect.
Test: atest SystemUITests
Test: atest WMShellTests
Test: Perfetto check enter & exit performance
Change-Id: I60f4e7a709f3a27fe6c7f480f1012caccdbbe5ec
2021-07-22 23:00:06 +08:00
Wei Sheng Shih
22bfc66d5d Merge "Using BaseIconFactory to draw legacy icon." into sc-dev am: 61d71ccaae
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15301161

Change-Id: I5cd5265571ec18a2b12a2270cebe6463c17cc871
2021-07-22 10:20:44 +00:00
Wei Sheng Shih
61d71ccaae Merge "Using BaseIconFactory to draw legacy icon." into sc-dev 2021-07-22 10:06:34 +00:00
Winson Chung
b9b673fb4a Skip animating out bubble screenshot if surface is not ready
Bug: 193634894
Test: atest SystemUITests
Change-Id: Ifb2ba00be2e8dc497300feb39bacb88b9021df4a
2021-07-22 04:29:56 +00:00
wilsonshih
45abb0b357 Using BaseIconFactory to draw legacy icon.
Use the shared launcher library to draw legacy icon.

Bug: 193780874
Test: launch app which still using legacy icon from Launcher.
Change-Id: Id8ccb5b6c532880ff207526fd754e92fdd08e284
2021-07-21 21:25:51 +08:00
TreeHugger Robot
fcdb62892c Merge "Fix entering PiP transition in button navigation mode" into sc-dev am: 73ef335c0f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15329896

Change-Id: I73c79942f7fc7fb44d881929121100aa768e53cd
2021-07-21 03:05:12 +00:00
TreeHugger Robot
73ef335c0f Merge "Fix entering PiP transition in button navigation mode" into sc-dev 2021-07-21 02:48:29 +00:00
Hongwei Wang
33c3fcc671 Fix entering PiP transition in button navigation mode
Included in this CL
- when there is no source rect hint, use a content overlay during the transition
- otherwise, take account the display cutout to offset/inset the source
  rect hint

Test with following variants when entering PiP in button nav
- from 0 / 90 / 270 rotation
- with or without source rect hint
- display cutout mode set to default or shortEdge

Video: http://recall/-/aaaaaabFQoRHlzixHdtY/cxk4vy8VenQPSv83vHEs22
Bug: 191310680
Test: manual, see the test cases listed and video above
Change-Id: Ie54a54de6e55397e25024373ea4e2855fde2d9f7
Merged-In: Ie54a54de6e55397e25024373ea4e2855fde2d9f7
2021-07-20 23:43:23 +00:00
Ben Lin
09755b5477 Merge "PiP: Allow customization of PiP minimum size." into sc-dev am: c312c6481b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14077517

Change-Id: Ief4c4e03a5042e08e17d358f7f16380bcaacea1e
2021-07-20 20:55:36 +00:00
Ben Lin
c312c6481b Merge "PiP: Allow customization of PiP minimum size." into sc-dev 2021-07-20 20:35:36 +00:00