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
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
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
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
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
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
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
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
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
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
* changes:
Revert "A unified data class to represent all the InputConnection call"
Revert "Fix error swallowing in InputConnectionCommand unparcelling"
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
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
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
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
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
We are mostly confident that this @UnsupportedAppUsage was a false
positive.
Fix: 194831602
Test: presubmit
Change-Id: Id836d48f19f6161030b1b77445777f8535bd78a3
We are mostly confident that this @UnsupportedAppUsage was a false
positive.
Fix: 194830651
Test: presubmit
Change-Id: I0b0f1932274d0ce074c94b73ee79d2c4707896cb