Commit Graph

758417 Commits

Author SHA1 Message Date
Kohsuke Yatoh
eae7ca8165 Do not cleanup IME window if show is requested.
This CL fixes a race condition for IMM#showSoftInput, which surfaces
when it's called during an IME hide animation.
IMM#showSoftInput ends up calling WIC#show asynchronously, but at that
time the running IME hide animation may have already been finished
successfully, and WIC#show may fail to cancel the hide animation
(then the cleanup IMM#notifyImeHidden hides the IME again disruptively).

I think a clean fix is to have IMM#showSoftInput call WIC#show
synchronously. However, this requires a significant refactoring.

As a short term fix, this CL adds a boolean field indicating whether or
not IMM#showSoftInput has been called. If it's called, we skip calling
IMM#notifyImeHidden.

Bug: 221483132
Bug: 225674038
Test: atest InputMethodStressTest
Test: atest CtsInputMethodTestCases
Test: atest WindowInsetsAnimationControllerTests
Change-Id: I36d570630085d0bc34097a2433208601dc9cb0fd
(cherry picked from commit 4c607982ed)
Merged-In: I36d570630085d0bc34097a2433208601dc9cb0fd
2022-04-21 21:34:31 +00:00
Kohsuke Yatoh
4844170377 Notify IMMS synchronously on IME insets hidden.
Currently, IMMS will be notified asynchronously when an IME hide
animation finishes, via message dispatching through IMS
(IMM#notifyImeHidden -> IMS#notifyImeHidden -> IMMS#hideMySoftInput).
This creates a race condition when IMM#showSoftInput or WIC#show is
called around the end of hide animation.

This CL fixes the race condition by synchronously and directly
calling IMMS#hideSoftInput from IMM#notifyImeHidden.

Note that there is still another race condition for IMM#showSoftInput
(not WIC#show) if it's called during an IME hide animation;
IMM#showSoftInput ended up calling WIC#show asynchronously, but at that
time the running IME hide animation may have already been finished
successfully and WIC#show may fail to cancel the hide animation
(then the cleanup IMM#notifyImeHidden hides the IME again disruptively).
I will fix the latter issue in a separate CL.

Bug: 221483132
Bug: 225674038
Test: atest InputMethodStressTest
Test: atest CtsInputMethodTestCases
Test: atest WindowInsetsAnimationControllerTests
Change-Id: I7c71dc5a1d6b61aa79d1666f0e257e6401e4adb2
(cherry picked from commit 9065310f81)
Merged-In: I7c71dc5a1d6b61aa79d1666f0e257e6401e4adb2
2022-04-21 21:34:24 +00:00
TreeHugger Robot
ee573f4e36 [automerger skipped] Merge "Import translations. DO NOT MERGE ANYWHERE" into sc-v2-dev am: 321bc7cceb -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17876523

Change-Id: Ia7a1e3d34fa6ef87f0007ce9477a44bbde833a31
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 21:31:25 +00:00
Bill Yi
950a46807a [automerger skipped] Import translations. DO NOT MERGE ANYWHERE am: c91b6268f7 -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17876523

Change-Id: I7389339146f07a0715dd696c1c4d35fa794a2905
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 21:31:14 +00:00
TreeHugger Robot
3ee7de7a2c [automerger skipped] Merge "Import translations. DO NOT MERGE ANYWHERE" into sc-v2-dev am: 793546f301 -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17876168

Change-Id: I0785e79539b85029940dccd2095150da43a91009
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 21:30:39 +00:00
Bill Yi
648d65030a [automerger skipped] Import translations. DO NOT MERGE ANYWHERE am: fc2e65f050 -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17876168

Change-Id: Ice9edf5935593d7b419598ec426426243a855756
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 21:30:10 +00:00
TreeHugger Robot
67e993c89a [automerger skipped] Merge "Import translations. DO NOT MERGE ANYWHERE" into sc-v2-dev am: 17db7dfc1a -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17845568

Change-Id: I8856023f4ab609ba1a5bdebcaeb73dab35c20ed8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 21:29:47 +00:00
Bill Yi
065238c643 [automerger skipped] Import translations. DO NOT MERGE ANYWHERE am: 90aca266a3 -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17845568

Change-Id: I5a9b7014f589d96c6d15b90e39f442c76bcd8056
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 21:29:08 +00:00
TreeHugger Robot
321bc7cceb Merge "Import translations. DO NOT MERGE ANYWHERE" into sc-v2-dev 2022-04-21 21:13:11 +00:00
TreeHugger Robot
793546f301 Merge "Import translations. DO NOT MERGE ANYWHERE" into sc-v2-dev 2022-04-21 21:13:11 +00:00
TreeHugger Robot
17db7dfc1a Merge "Import translations. DO NOT MERGE ANYWHERE" into sc-v2-dev 2022-04-21 21:13:11 +00:00
Caitlin Cassidy
6e947afdab [Media] Allow a11y interactions to change seekbar position.
Note that the seekbar UI can now get a bit janky if
you have TalkBack on and you very quickly swipe up or down. We can file
a new bug for that if we decide it needs fixing.

Fixes: 216254595
Fixes: 216254099
Test: SeekBarViewModelTest
Test: manual: Turn TalkBack on, select the seekbar, and verify you can
swipe up/down to change the track position.
Test: manual: Verify seeking without TalkBack on still works.

Change-Id: I890e4f396fa704047c5593fff20c8924b890fc75
2022-04-21 21:09:19 +00:00
Dave Mankoff
6584dbb6e6 Merge "Cleanup GlobalModule." into tm-dev 2022-04-21 20:48:54 +00:00
Kathy Chen
dbc7e4a31e Fix a typo in AbstractMasterSystemService.
Test: make and flash device
Change-Id: I4757dd904748ffd6d6b1f794d1154d58dfce4c1a
2022-04-21 20:05:02 +00:00
TreeHugger Robot
fbcba37205 Merge "Check appOp in testWakefulnessAwake_AcquireCausesWakeup" into tm-dev 2022-04-21 19:23:32 +00:00
Mitch Phillips
ecaeb5a153 Merge "[GWP-ASan] Use new GWP-ASan android_mallopt()" am: a50c4137e3 am: 65b39e8f66 am: a94d0a79ce
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2040626

Change-Id: If42e3edea739733272fa9b1ecfc8f5bfb73b8490
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 19:18:20 +00:00
Nikita Dubrovsky
18a113c42d Merge "Remove manual pregrants for ContentCaptureService (now handled via roles)" into tm-dev 2022-04-21 19:12:26 +00:00
Mitch Phillips
a94d0a79ce Merge "[GWP-ASan] Use new GWP-ASan android_mallopt()" am: a50c4137e3 am: 65b39e8f66
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2040626

Change-Id: I505cb495696262fad33cb20ab54af65f5eb65313
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 18:58:06 +00:00
Tim Murray
47032a2095 Icon: make Icon's Bitmaps immutable
Because Bitmap mutability is propagated across Parcel and Binder, the
following problem can happen when sending an Icon containing a Bitmap
as part of a Notification:

1. App creates Icon with a mutable Bitmap (1 alloc)
2. App sends Icon to system_server, often creating ashmem Bitmap (2 allocs)
3. system_server converts ashmem Bitmap back to heap Bitmap (3 allocs)
4. system_server sends heap Bitmap to each NotificationListener individually,
converting the heap Bitmap to ashmem each time (3+N allocs)
5. NotificationListener converts ashmem Bitmap to heap Bitmap (3+2N allocs)

This is inefficient. This is especially bad because the API to update
a Notification involves sending a full Notification object, including
Icons, repeatedly, and some apps do that several times per second.

Instead, ensure that all Bitmaps transmitted as part of Icons are
immutable. Instead, we get:

1. App creates Icon, which may copy to immutable Bitamp (1 or 2 allocs)
2. App sends Icon to system_server over ashmem (still 1 or 2 allocs)
3. system_server uses received ashmem Bitmap directly (still 1 or 2 allocs)
4. system_server sends same ashmem Bitmap to NotificationListeners (1 or 2)
5. Each NotificationListener uses the same ashmem Bitmap (1 or 2)

This solves the per-NotificationListener amplification, but it does
not solve sending what is likely the same Bitmap N times per second
when apps update Notifications. That will require either app changes
or Notification API changes to avoid bytewise comparisons for all
Bitmaps.

Test: boot, notifications work, memory in maps/gearhead remains good
Bug: 227920378

Change-Id: If92835f647a76da599f358c7c02888e3e2f59235
2022-04-21 18:54:53 +00:00
Vinit Nayak
5444cdda33 Remove check for preventing re-parenting non-split apps
* Removed the check and the original use-case it was
there for still works.

Bug: 223396876
Change-Id: I01590e53c612e00780d58c3dc7bcd32168fb885f
2022-04-21 11:51:41 -07:00
Lyn Han
617bb19958 Merge "Update test names to kotlin style" into tm-dev 2022-04-21 18:51:05 +00:00
Yohei Yukawa
445ee3c0f1 Fix testGetSurroundingTextFailWithNegative{Before,After}LengthForA11y
This is a follow up CL to my previous CLs[1][2], which are submitted
almost at the same time but not compatible with each other.

The first CL [1] introduced a new behavior that negative indices
passed to

  AccessibilityInputConnection#getSurroundingText(int, int, int)

result in IllegalArgumentException, which is a different behavior than
what's observed from IMEs.

The second CL [2] assumed that negative indices passed to that API
result in just receiving null result like what's observed from IMEs.

This CL effectively reverts the new behavior introduced in the first
CL [1] to keep two observable behaviors consistent.

Note that negative indices passed to getSurroundingText() are already
handled in

  RemoteInputConnectionImpl#getSurroundingText()

in a graceful manner [3], which guarantees that the IME client process
will not see such an irregular parameter (Bug 169114026) with keeping
the InputConnection commands order (Bug 194110780).

 [1]: I5ff2e804cbcf90828370a0612ff54111130bdff4
      c60176c1f3
 [2]: I62b80916369bdac981dc93c14dcaedc1f2b6e95f
      495ac0f55cbcc976995e8c73fdc89babfbdce902
 [3]: Ie0c18d0c9b8bf8f02f2fcdca5aac7e580c6bf2cd
      8821afef81

Bug: 215633021
Fix: 229981360
Test: atest CtsInputMethodTestCases:InputConnectionEndToEndTest
Change-Id: I16a0185343c7c7c3e0947aab2c398714a1077b97
2022-04-21 11:38:51 -07:00
Tim Murray
e9a0acdfda Merge "RemoteViews: make bitmaps immutable" into tm-dev 2022-04-21 18:32:21 +00:00
Mitch Phillips
65b39e8f66 Merge "[GWP-ASan] Use new GWP-ASan android_mallopt()" am: a50c4137e3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2040626

Change-Id: I2938b379266633eeb74b9cb5619298920e18480f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 18:32:15 +00:00
Benedict Wong
83e6ae270a Merge "Add CarrierConfig to TelephonySubscriptionSnapshot" am: 59aeaf29c0 am: d868725c8c am: 1670176e65
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2063410

Change-Id: I83b7473cc8358213b5ce87781cb534d9ebf79991
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 18:27:16 +00:00
Treehugger Robot
0760c5a6af Merge "fix API description on how to round average qp" am: 1c0277d78d am: 8428f9e7cd am: e766c3d7d9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2067619

Change-Id: I85a79479d8fa4998fa2e0995d5f28cca76486465
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 18:26:36 +00:00
Seth Moore
6615ac8b34 Merge "Make generateKey() return a status" am: d6dbf31c61 am: 34eb18107d am: c6030f0765
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2048789

Change-Id: Ib86d332d64f0fae0d83d52a6e55d9dfc25c4f06b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 18:25:10 +00:00
Treehugger Robot
814a75d586 Merge "Exclude flaky tests from CtsGraphicsTestCases" am: 64c920c24d am: 5d145dbcc0 am: ff646ddc80
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2068130

Change-Id: I2be1a106f68dbef3d2b0c85fd9d3eb406c7502c5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 18:24:18 +00:00
Josh Tsuji
30183c1cf8 Merge "Invalidate home task snapshot onWakeAndUnlock." into tm-dev 2022-04-21 18:23:28 +00:00
Mitch Phillips
a50c4137e3 Merge "[GWP-ASan] Use new GWP-ASan android_mallopt()" 2022-04-21 18:12:44 +00:00
Song Hu
fe3f81eb61 In getMatchingShareTargets, add callerLauncher to fetch sharesheet marked pin info.
Bug: 210453009
Test: test on the local phone
Change-Id: I8872cdd2917580ff86dcf7a2d7a40a445fbd70b3
(cherry picked from commit 520e7d40ab)
Merged-In: I8872cdd2917580ff86dcf7a2d7a40a445fbd70b3
2022-04-21 18:08:22 +00:00
Sally
daf03e85c3 Remove recycling references in A11yNodeInfo
Notably eliminate references in RangeInfo and CollectionInfo class
descriptions. We've just deprecated obtain and recycle, so keeping
outdated docs is confusing.

Test: builds
Bug: 229991765
Change-Id: Ia2d7963bf572740052e0da03950398d016a3caa4
2022-04-21 18:06:20 +00:00
Ben Lin
ec56afe31b Merge "PiP: Re-attach PiP menu when display changes." into tm-dev 2022-04-21 18:05:03 +00:00
Benedict Wong
1670176e65 Merge "Add CarrierConfig to TelephonySubscriptionSnapshot" am: 59aeaf29c0 am: d868725c8c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2063410

Change-Id: Ie930a21f12808130b6db9d503f4fc127a2897ee4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 17:53:40 +00:00
Treehugger Robot
e766c3d7d9 Merge "fix API description on how to round average qp" am: 1c0277d78d am: 8428f9e7cd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2067619

Change-Id: If04ce9418acedf027fb31e3970eded1f3516b9a9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 17:53:30 +00:00
Seth Moore
c6030f0765 Merge "Make generateKey() return a status" am: d6dbf31c61 am: 34eb18107d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2048789

Change-Id: Ia29166a47d7ed4cdde3df5df28322120e684d9de
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 17:53:03 +00:00
Treehugger Robot
ff646ddc80 Merge "Exclude flaky tests from CtsGraphicsTestCases" am: 64c920c24d am: 5d145dbcc0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2068130

Change-Id: Ief68c23cfa99bb4bf05083f1ca4804a4ba9ebf70
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 17:52:36 +00:00
Benedict Wong
d868725c8c Merge "Add CarrierConfig to TelephonySubscriptionSnapshot" am: 59aeaf29c0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2063410

Change-Id: I5e09fea770734d71241008395045dd9ddddc0ca6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 17:51:46 +00:00
Treehugger Robot
8428f9e7cd Merge "fix API description on how to round average qp" am: 1c0277d78d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2067619

Change-Id: Ib4ec8372d8f63bc6d7d73ac60aa40dd7ead097a6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 17:51:28 +00:00
Mark Punzalan
4fe28a4d24 Rename translationActivityUid to translatedAppUid.
Bug: 192331240
Test: N/A - Just renaming
Change-Id: Ib85ba777a15f9c63bb6349dbe5974c84a1f6b0eb
2022-04-21 17:43:42 +00:00
Mark Punzalan
94ed570f35 Reduce duplicate UiTranslationStateCallback calls.
We don't invoke methods when translation state doesn't change (e.g.,
for consecutive startTranslation() calls).

Bug: 192331240
Test: atest UiTranslationManagerTest
Change-Id: I96def427b1fcabb7b83cb188c4b1ee017b5882a9
2022-04-21 17:43:42 +00:00
Benedict Wong
59aeaf29c0 Merge "Add CarrierConfig to TelephonySubscriptionSnapshot" 2022-04-21 17:40:58 +00:00
Treehugger Robot
1c0277d78d Merge "fix API description on how to round average qp" 2022-04-21 17:32:29 +00:00
Seth Moore
34eb18107d Merge "Make generateKey() return a status" am: d6dbf31c61
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2048789

Change-Id: Ie70204d5eb098d57f5238f7da105b84365ee7c7c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 17:29:29 +00:00
Treehugger Robot
5d145dbcc0 Merge "Exclude flaky tests from CtsGraphicsTestCases" am: 64c920c24d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2068130

Change-Id: If74d93d8b2f4a26df8ee777b091cdd315803ffe4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 17:28:48 +00:00
Seth Moore
d6dbf31c61 Merge "Make generateKey() return a status" 2022-04-21 17:23:11 +00:00
Makoto Onuki
020c607e75 Remove STOPSHIP
Fix: 221248960
Test: Boot, treehugger
Change-Id: Ib313e21f4df1b117514887b58f8c229ad87de58f
2022-04-21 10:23:10 -07:00
Jay Sullivan
04b94c550d Merge "Update strings (for media permissions)" into tm-dev 2022-04-21 17:12:01 +00:00
Treehugger Robot
64c920c24d Merge "Exclude flaky tests from CtsGraphicsTestCases" 2022-04-21 17:03:50 +00:00
Jay Sullivan
0afa5059a5 Merge "Don't re-prompt for VISUAL/AURAL after app upgrade" into tm-dev 2022-04-21 17:03:23 +00:00