Commit Graph

17271 Commits

Author SHA1 Message Date
Yohei Yukawa
d55ddf27c6 Ensure View#onInputConnectionClosedInternal() timing
This is a follow up CL to our previous CLs [1][2], which introduced
an @hide callback

  View#onInputConnectionClosedInternal()

to notify View when an is closed.

What this CL aims to do is to fix a potential problem in a code path
that has not been yet used.  Thus there should be, in theory, no
observable app compat impact.

The problem is that

  RemoteInputConnectionImpl#deactivate()

can dispatch

  A: View#onInputConnectionClosedInternal()

before

  B: InputConnection#closeConnection()

is completed when A and B need to be dispatched to two different
threads.  This can, in theory, happen when

  A: View#onInputConnectionClosedInternal()
  C: InputConnection#getHandler()

are both explicitly overridden.  That said, A is still @hide and only
by TextView, which basically does not support InputConnection with a
custom InputConnection#getHandler().

Anyway, with this CL A is guaranteed to happen after B under any
circumstances.

 [1]: Iaafb0a03126c9292c24415f866dbdd72cadfa239
      7b384751ea
 [2]: I9280604e7ec7e8d08c1179e6bbf0068647a41040
      7b384751ea

Bug: 163400105
Test: atest FrameworksCoreTests:ViewInputConnectionTest
Change-Id: I8a0e321ecf6e0b3be4b6ab1a35e6ac7259826c2e
2021-08-05 17:02:02 -07:00
Yohei Yukawa
d1ff9740c1 Lock down RemoteInputConnectionImpl#getInputConnection()
This is a mechanical refactoring CL that locks down

  RemoteInputConnectionImpl#getInputConnection()

as a private method.

This is supposed to be helpful to to avoid future misuse of raw
InputConnection instance outside RemoteInputConnectionImpl.

Note that InputMethodManager#isAcceptingText() remains to have the
same observable behavior in this CL.  The key fact is that the
following two fields are updated in an atomic way.

  * RemoteInputConnectionImpl#mInputConnection
  * RemoteInputConnectionImpl#mFinished

Bug: 192412909
Test: presubmit
Change-Id: Ic5fbc6213ad62df95fc0b7eef18bab1fd9fbdbf1
2021-08-04 11:57:42 -07:00
Yohei Yukawa
b37f32cfec Let IC#reportFullscreenMode() honor IC#getHandler()
This CL fixes a regression that

  InputConnection#reportFullscreenMode()

is always called back on the main thread rather than its associated
thread.  In most of cases those two threads are the same hence there
is no semantic problem, threads are the same, but for some special
cases, e.g. when apps explicitly override

  InputConnection#getHandler(),

our thread affinity contract can be violated.

This regression was accidentally introduced in Android O time frame
while attempting to make the system more robust at Bug 28406127 [1].

Although we have never received any actual issue report from app
developers so far, this is still worth fixing.

 [1]: If23e7c7c265ab3dfb48c2fb6fdb361b17d22c594
      2bc66171cc

Bug: 28406127
Fix: 193588937
Test: atest CtsInputMethodTestCases:InputConnectionHandlerTest
Change-Id: Id3ac21c11d6b062bb66719109376ff642309b8ff
2021-08-04 11:37:16 -07:00
Yohei Yukawa
002ceeec8d Merge "Rename IInputConnectionWrapper to RemoteInputConnectionImpl" 2021-08-04 16:34:25 +00:00
Yohei Yukawa
23463870e9 Merge "Remove inaccurate words "main thread" from IInputConnectionWrapper" 2021-08-04 15:34:44 +00:00
Jeff DeCew
ab188125a5 Merge "Collapse the CallStyle buttons to just an icon instead of truncating text." 2021-08-04 15:19:44 +00:00
Yohei Yukawa
5693db4d66 Rename IInputConnectionWrapper to RemoteInputConnectionImpl
This is a mechanical refactoring CL that renames

  com.android.internal.view.IInputConnectionWrapper

to

  com.android.internal.inputmethod.RemoteInputConnectionImpl

with no observable behavior change.

Bug: 192412909
Test: presubmit
Test: No lint error under core/java/com/android/internal/inputmethod
Change-Id: I171106ad0b46fbb495a6bf08d10f33915c2d29ac
2021-08-03 14:34:36 -07:00
Yohei Yukawa
d6a6037196 Remove inaccurate words "main thread" from IInputConnectionWrapper
This is a clean-up CL for up my CL [1], which introduced

  InputConnection#getHandler()

per request from the Chromium team.

This CL only renames misleading and/or inaccurate code commends and
field names.  There should be no observable behavior change.

Even before my change [1], IInputConnectionWrapper had been
responsible for re-dispatching incoming IPCs onto the "UI thread"
obtained from View#getHandler(), which is not guaranteed to be the
"main thread" in some rare situations.

With my change [1], the target thread is no longer limited to the UI
thread.

This CL removes misleading and confusing "main" terminology from the
variable names and comments for future readers.

 [1]: Id9e579bb3e2966986cdcb1c34bc8cacfeca2e1a9
      612cce92ad

Bug: 26945674
Bug: 192412909
Test: presubmit
Change-Id: Ibb31da4f66e8a6cd35f93c3ca1cc0f871dfb3b73
2021-08-03 14:34:05 -07:00
Nate Myren
aad177261c Merge "Add attribution info to start callbacks" into sc-dev am: 5d97f29218 am: d1a82a7de8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15446590

Change-Id: Ic800a8e11e6d8513629ec8e9b1f64ffef0c85645
2021-08-03 20:18:08 +00:00
Jeff DeCew
4748afe362 Collapse the CallStyle buttons to just an icon instead of truncating text.
Fixes: 195019654
Test: post CallStyle notification without custom action; observe text
Test: post CallStyle notification with custom action; observe buttons shrink to icon only.
Test: repeat tests using various font and screen sizes.
Change-Id: Icbd6189a1e03494e481e8672263570ae2657f946
2021-08-03 20:09:56 +00:00
Nate Myren
06d07d54db Add attribution info to start callbacks
Add attribution flags and chain IDs to start callbacks, and have the
PermissionUsageHelper listen for starts. This ensures that, if another
start happens while an op is already running, and has chain information,
then this chain information will be recorded.

Test: manual
Bug: 194198234
Change-Id: I0ab1aa0969b70e18001f4a814ea5689f9329a019
2021-08-03 08:25:31 -07:00
Yohei Yukawa
ca41a89bc9 Fix lint warnings in IInputConnectionWrapper
This is a clean-up CL of IInputConnectionWrapper with no behavior
change.

As a preparation to move IInputConnectionWrapper into

  com.android.internal.inputmethod

this CL cleans up all the existing lint warnings in this file.

There should be no behavior change in this CL.

Bug: 192412909
Test: presubmit
Change-Id: I215437cc4e45f369af56e3d42fdc2bdc6d353a4f
2021-08-02 18:00:01 -07:00
Wu Ahan
e7bcbbab71 Merge "Support surface only instrumentation" into sc-v2-dev am: d6d30bf7f6 am: 60894eefb5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15256893

Change-Id: I2f43c2ba720d08446210639cb417af6dd2bc1266
2021-08-02 10:33:28 +00:00
Wu Ahan
60894eefb5 Merge "Support surface only instrumentation" into sc-v2-dev am: d6d30bf7f6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15256893

Change-Id: I78d98f78086ace09d32fac4329c6b3357aed56b5
2021-08-02 10:23:59 +00:00
Wu Ahan
d6d30bf7f6 Merge "Support surface only instrumentation" into sc-v2-dev 2021-08-02 10:06:03 +00:00
Nataniel Borges
764792b6cb Merge "Introduce a .winscope extension for all winscope files" 2021-08-02 08:07:20 +00:00
Yohei Yukawa
d72d5a169c Move InputBindResult to com.android.internal.inputmethod
This CL mechanically moves InputBindResult from

  com.android.internal.view

to

  com.android.internal.inputmethod

without changing any observable behavior.

Bug: 192412909
Test: presubmit
Test: No lint error under core/java/com/android/internal/inputmethod
Change-Id: Ifd68c8a0a0d1b410c9a480ad39ca470fe2da5bc6
2021-07-30 13:08:44 -07:00
Yohei Yukawa
300f2ee283 Fix lint errors in InputBindResult
This is a clean-up CL of InputBindResult with no behavior change.

As a preparation to move InputBindResult into

  com.android.internal.inputmethod

this CL cleans up all the existing lint warnings in this file.

There should be no behavior change in this CL.

Bug: 192412909
Test: prebuilts/checkstyle/checkstyle.py  -f \
  frameworks/base/core/java/com/android/internal/view/InputBindResult.java
Change-Id: I5c94e6d8f91656654065c624257971ae7835a1aa
2021-07-30 13:08:13 -07:00
Yohei Yukawa
13ada96055 Merge "Simplify IInputConnectionWrapper" 2021-07-30 19:49:16 +00:00
Yohei Yukawa
3c596e3985 Merge changes I0ef1e1b4,Ia4043178
* changes:
  Revert "A unified data class to represent all the InputConnection call"
  Revert "Fix error swallowing in InputConnectionCommand unparcelling"
2021-07-30 17:47:49 +00:00
Li Li
69d46fa9b7 Merge "Freezer: fix exception when parsing /proc/locks" into sc-dev am: ef12967b75 am: 57240b0a67
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15395534

Change-Id: I8605df085ec636ea1dba1096076bee5c1d6dd4f4
2021-07-30 17:07:55 +00:00
Li Li
d7306136e8 Merge "Freezer: fix exception when parsing /proc/locks" into sc-dev am: ef12967b75 am: d2aeb490a8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15395534

Change-Id: Ica77c69580dd69bed4e260779c1f7318307282b1
2021-07-30 17:03:54 +00:00
Li Li
d2aeb490a8 Merge "Freezer: fix exception when parsing /proc/locks" into sc-dev am: ef12967b75
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15395534

Change-Id: I28f1b15ab636063727f02414a98896ee2679c6fc
2021-07-30 16:50:50 +00:00
Li Li
ef12967b75 Merge "Freezer: fix exception when parsing /proc/locks" into sc-dev 2021-07-30 16:35:16 +00:00
Yohei Yukawa
df38b9c68c Simplify IInputConnectionWrapper
This is a mechanical refactoring CL for IInputConnectionWrapper with
no observable behavior change.

This is a preparation CL before introducing InputConnection task
cancellation (Bug 195115071).

Bug: 192412909
Test: test CtsInputMethodTestCases:InputConnectionEndToEndTest
Change-Id: I814377fd7f73d65f0d5526feebb6bf39e19809d7
2021-07-30 09:13:07 -07:00
Yohei Yukawa
7eec13b458 Revert "A unified data class to represent all the InputConnection call"
This reverts commit 2757c24880 [1].

Reason for revert:
We will try another approach to implement InputConnection task
cancellation without InputConnectionCommand.

 [1]: I86eba7185b4b0664c1b0b3da794dfc5eeddc725c

Bug: 194151409
Change-Id: I0ef1e1b498b77caf7704742d88c7c81944d75c42
Test: atest CtsInputMethodTestCases:InputConnectionEndToEndTest
2021-07-30 09:07:36 -07:00
Yohei Yukawa
da04fd9eb8 Revert "Fix error swallowing in InputConnectionCommand unparcelling"
This reverts commit 11694b0633 [1].

Reason for revert:
We will try another approach to implement InputConnection task
cancellation without InputConnectionCommand.

 [1]: Icd2b40e63771085cb8d88721fbdca7a089256b28

Bug: 194151409
Bug: 194567417
Change-Id: Ia404317848d74a0d8ca0606bfb07cbad36ab97c1
Test: atest CtsInputMethodTestCases:InputConnectionEndToEndTest
2021-07-30 09:06:19 -07:00
Ahan Wu
7141ab2619 Support surface only instrumentation
- Support surface only instrumentation.
- Add enums for pip and wallpaper instrumentation.

Bug: 170708749
Test: atest InteractionJankMonitorTest
Test: atest FrameTrackerTest
Change-Id: Iec1eb82d1a4756a7b85c8fbdd05f4132a74c613c
2021-07-29 19:21:31 -08:00
Daniel Solomon
070300e858 Merge "Revert "SCREEN_BRIGHTNESS - map 255 to current max"" into sc-dev am: d5e1458566
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15404418

Change-Id: Ie65fbb748337a030492d515bbea94c551398b5f5
2021-07-29 19:15:35 +00:00
Hai Zhang
0f17f27c77 Merge "Only construct real Throwable objects in AndroidFuture.readThrowable()." into sc-dev am: af04dd2ad5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15302018

Change-Id: I1bf40fe706b0f03443a8a6fbb6e8c84b0fa44402
2021-07-29 19:12:13 +00:00
Li Li
bbe06e7b59 Freezer: fix exception when parsing /proc/locks
The original code is based on /proc/locks manpage. Unfortunately, that
manpage is never correctly updated to include the new field for blocked
locks. The new code detects the extra field. As StringTokenizer is too
heavy, ProcFileReader is used for better performance.

Bug: 194756340
Test: FrameworksUtilTests com.android.internal.util.ProcFileReaderTest
Test: FrameworksCoreTests com.android.internal.os.ProcLocksReaderTest
Test: No /proc/locks parsing exception with blocked locks
Change-Id: I4c9763f9d3091f7d84d2e4b672d7e5cb78b33f59
2021-07-29 09:18:53 -07:00
Siim Sammul
76b63d54cf Merge "Do not make a getThreadTimeMicro() call when it is not needed. This was accidentally changed with https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15080830" into sc-dev am: 6c852aeabc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15346904

Change-Id: Ibaae003e403fc6d20002a62241ec23a0fa97f2ce
2021-07-28 18:25:11 +00:00
Alison Cichowlas
7bed52f477 Merge "Sharesheet: remove 2 separators, restyle the 3rd." into sc-dev am: 832779a555
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15377016

Change-Id: I37ce8ef56bc0cb8efd24e899406f30b7242738ae
2021-07-28 18:24:05 +00:00
Daniel Solomon
d953a29d69 Merge "Revert "SCREEN_BRIGHTNESS - map 255 to current max"" into sc-dev am: d5e1458566 am: 8c6caab15c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15404418

Change-Id: I9419af82f3d88c6f39c403ac1b94d90482dbe02c
2021-07-28 18:24:00 +00:00
Daniel Solomon
d41a2a1ca0 Merge "Revert "SCREEN_BRIGHTNESS - map 255 to current max"" into sc-dev am: d5e1458566 am: ae50161de8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15404418

Change-Id: I1f94be5d70453b6ef0a28d8c1a680a8880242e04
2021-07-28 18:11:11 +00:00
Daniel Solomon
ae50161de8 Merge "Revert "SCREEN_BRIGHTNESS - map 255 to current max"" into sc-dev am: d5e1458566
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15404418

Change-Id: I7782fd8704f1b7c2444b6630ce001875b19d6931
2021-07-28 17:58:09 +00:00
Daniel Solomon
d5e1458566 Merge "Revert "SCREEN_BRIGHTNESS - map 255 to current max"" into sc-dev 2021-07-28 17:42:43 +00:00
Daniel Solomon
792229b553 Revert "SCREEN_BRIGHTNESS - map 255 to current max"
This reverts commit 002e656a51.

Reason for revert: Setting brightness using adb (adb shell settings put system screen_brightness ...) results in different brightness being set by DisplayPowerController each time.

Bug: 194791517
Test: atest HighBrightnessModeControllerTest
Test: manually test `settings put system screen_brightness 23` yields
      consistent results
Change-Id: I6b49253b46e4d09a1f4129d3df950c9d36eb6ede
2021-07-28 17:17:15 +00:00
Yohei Yukawa
2cab8c518f Merge "Remove @UnsupportedAppUsage from InputBindResult#CREATOR" 2021-07-28 16:23:20 +00:00
Yohei Yukawa
19ab748b9a Merge "Remove @UnsupportedAppUsage from InputBindResult#method" 2021-07-28 15:14:40 +00:00
Alison Cichowlas
82cee4bd0a Merge "Sharesheet: be more defensive about un-unparcelable intents." into sc-dev am: a1d1a38269
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15374840

Change-Id: I24bf7607ee67bfba322f0f03a62eb58745b98a79
2021-07-28 15:03:08 +00:00
Santos Cordon
28c5f05a22 Merge "SCREEN_BRIGHTNESS - map 255 to current max" into sc-dev am: e4e836a175
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15359296

Change-Id: I0e027bc0ecbdea29c8b86c1785dc514e69efdff8
2021-07-28 14:55:42 +00:00
Alison Cichowlas
b566f49ae4 Merge "Sharesheet: action bar is independent of WP tabs, should always launch as primary user." into sc-dev am: 9197f7b260
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15363687

Change-Id: I23d9a8b26412d255f50093f6b8f5cfa9bed00052
2021-07-28 14:50:52 +00:00
Hai Zhang
2af324b732 Merge "Only construct real Throwable objects in AndroidFuture.readThrowable()." into sc-dev am: af04dd2ad5 am: 831f5db04f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15302018

Change-Id: I07948cad1d44aaaeb68f0f4c9a44e17ec104749d
2021-07-28 02:03:31 +00:00
Hai Zhang
8c0e7d693b Merge "Only construct real Throwable objects in AndroidFuture.readThrowable()." into sc-dev am: af04dd2ad5 am: 92414a05dc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15302018

Change-Id: I269629173d5a291c3e4575b21255394cf9564b73
2021-07-28 01:58:36 +00:00
Hai Zhang
831f5db04f Merge "Only construct real Throwable objects in AndroidFuture.readThrowable()." into sc-dev am: af04dd2ad5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15302018

Change-Id: I2afc85c266bebcb88848c57a094ed0af757b277e
2021-07-28 01:41:05 +00:00
Hai Zhang
af04dd2ad5 Merge "Only construct real Throwable objects in AndroidFuture.readThrowable()." into sc-dev 2021-07-28 01:23:12 +00:00
Yohei Yukawa
c362e57266 Remove @UnsupportedAppUsage from InputBindResult#CREATOR
We are mostly confident that this @UnsupportedAppUsage was a false
positive.

Fix: 194831602
Test: presubmit
Change-Id: Id836d48f19f6161030b1b77445777f8535bd78a3
2021-07-27 15:03:44 -07:00
Yohei Yukawa
45dc08a19d Remove @UnsupportedAppUsage from InputBindResult#method
We are mostly confident that this @UnsupportedAppUsage was a false
positive.

Fix: 194830651
Test: presubmit
Change-Id: I0b0f1932274d0ce074c94b73ee79d2c4707896cb
2021-07-27 14:55:33 -07:00
Yohei Yukawa
5f21071816 Merge "Fix error swallowing in InputConnectionCommand unparcelling" 2021-07-27 16:11:53 +00:00