Commit Graph

1549 Commits

Author SHA1 Message Date
Ming-Shin Lu
f38f1ebb7d RESTRICT AUTOMERGE: Fix snapshot starting window stuck if the task never gain focus am: a4f760bee7 am: 72ea33eb75
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15937022

Change-Id: Ib76cbe68741833fe597a828f167e715043814627
2021-09-30 10:25:54 +00:00
Ming-Shin Lu
72ea33eb75 RESTRICT AUTOMERGE: Fix snapshot starting window stuck if the task never gain focus am: a4f760bee7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15937022

Change-Id: I92e206162b407c1cf014bad5878ed5093693cd72
2021-09-30 10:14:29 +00:00
Ming-Shin Lu
a4f760bee7 RESTRICT AUTOMERGE: Fix snapshot starting window stuck if the task never gain focus
The tasksnapshot starting window could stuck on task if the task never
gain focus, this could happen when launch multiple tasks to front, e.g.
split screen, or add snapshot starting window to a pip task.

As using task focus to judge the task snapshot removal may error-prone.
(i.e. unexpected window focus in/lost, non-focusable task window..)

To ensure the tasksnapshot removal works stable in this stage, extanding
MAX_DELAY_REMOVAL_TIME_IME_VISIBLE timeout from 450ms to 600ms
(Includes the worst time perviod from tasksnapshot drawn to the task window
focused around 150ms) would be safer and keeps the behavior of original
fixed Bug 192065018.

Bug: 201264769
Test: atest ActivityRecordTests
Test: manual launch apps from Recents.
Test: enter pip, power on/off, verify starting window is removed.
Test: manual enter split screen, verify starting window is removed.
Merged-In: Ieb5a5e781f5da4228cfc493031b4ad17f2d31a77
Change-Id: Ieb5a5e781f5da4228cfc493031b4ad17f2d31a77
2021-09-29 19:20:36 +08:00
Ming-Shin Lu
b8ed139313 RESTRICT AUTOMERGE: More improve IME transition during task switch am: 5c23301322
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15888530

Change-Id: Iac595386990d5f42f81318e280865cf0f5b30f0b
2021-09-25 04:19:10 +00:00
TreeHugger Robot
d92e142ac4 Merge "RESTRICT AUTOMERGE: More improve IME transition during task switch" into sc-dev 2021-09-25 04:00:43 +00:00
Bill Yi
8cb6e80e2d Merge "Import translations. DO NOT MERGE ANYWHERE" into sc-dev 2021-09-24 22:31:38 +00:00
Ming-Shin Lu
e730ad6ec7 Merge "Modify TaskSnapshotWindow#scheduleRemove" into sc-qpr1-dev am: d820697e08
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15896148

Change-Id: I3a1830cfffdd939285e603bdea39e7454165e443
2021-09-24 08:54:38 +00:00
Ming-Shin Lu
102c525452 Modify TaskSnapshotWindow#scheduleRemove
As code review in CL[1] from sc-dev, we should preserve the previous
logic to remove home task snapshot immediately, in order to show latest
content as soon as possible for unlocking to home.

Note that this CL is to sync the logic CL[1] in sc-dev for the
downstream branch (qpr1 and v2, and internal master)

[1] I81031f64966b1aeb55cc09f381d4d83ec3460dc9 (sc-dev)

Bug: 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: Ic0cb07504acc11707327360051612df9cce565bd
2021-09-24 04:58:07 +00:00
Bill Yi
b33cc8091c Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I555196d61c9123b77d07d4bed47b08a19a4a7505
2021-09-24 01:23:37 +00:00
Bill Yi
063bcacc7a Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I037c4ff660c2eed06d4dc09507334300e10fd7b1
2021-09-24 01:18:08 +00:00
Ming-Shin Lu
5c23301322 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
(cherry picked from commit 278e944fd5)
2021-09-23 20:45:27 +08:00
Winson Chung
412d4be7a7 Merge "Ensure wm is fetched on the shell thread" into sc-qpr1-dev am: 938b7d01f5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15881354

Change-Id: I9a6550abbfb20a183084a80c2c041e34042148f0
2021-09-22 02:49:35 +00:00
Winson Chung
da6e8a5f77 Ensure wm is fetched on the shell thread
Bug: 199700116
Test: atest PinnedStackTests
Change-Id: I1aa925bc2ee2bd093b82f18432b548f785f232f4
2021-09-21 21:29:15 +00:00
TreeHugger Robot
d2393cc7e4 Merge "Fix OHM H/W key shortcut dosn't work appropriately" into sc-qpr1-dev am: 9a57cd553b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15581982

Change-Id: I14c637fdd36d220711c24a5c4d75097c98a5da3d
2021-09-16 00:49:18 +00:00
TreeHugger Robot
9a57cd553b Merge "Fix OHM H/W key shortcut dosn't work appropriately" into sc-qpr1-dev 2021-09-16 00:40:58 +00:00
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
TreeHugger Robot
32efa155f4 Merge "RESTRICT AUTOMERGE: More improve IME transition during task switch" into sc-qpr1-dev 2021-09-15 01:04:13 +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
Bill Yi
999cc105b3 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I4f8eec1615c3f186a2db9bf316c038e4aa111ab1
2021-09-10 22:15:59 +00:00
Bill Yi
97fa83e0ec Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I616e2bd98ad38e2422eea203bf0fcc8bd9305de3
2021-09-10 22:14:33 +00:00
Bill Lin
08898e3dde Fix OHM H/W key shortcut dosn't work appropriately
When one-handed mode disabled
1. Turn on the shortcut of the OHM with hold volume keys
2. Hold the volume keys
Should trigger one-anded mode

Due to S/W & H/W shortcut keys are mapping to different settings
S/W : ACCESSIBILITY_BUTTON_TARGETS
H/W : ACCESSIBILITY_SHORTCUT_TARGET_SERVICE
We should check both status of the them.

Bug: 193411296
Bug: 198739184
Test: atest WMShellUnitTests
Change-Id: I3994ab89fd6163c283969cc3175877e29b44c67a
Merged-Id: I3994ab89fd6163c283969cc3175877e29b44c67a
2021-09-08 16:52:47 +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