This is a follow up CL to our previous CL [1], which introduced
InputMethodManager#hasActiveInputConnection(View)
as a test API.
As this remains to be a test API, we should be able to tweak its
behavior as long as existing use cases continue working.
The main motivations of this CL is to make it more predictable and
easier to understand.
Even with simplification, ImeAwareEditText and CTS tests should
continue working as expected. Also there must be no app compatibility
concern in this CL.
[1]: I466a93e2b4706ae809ac50dc16dc8e4ffa7c2f1c
8bcce88c86
Bug: 176697749
Bug: 182259171
Test: presubmit
Change-Id: I7fe8b18ffbb450fd1e272e15f06f2629518f320c
For a given WeakReference<T> ref,
ref.refersTo(obj)
is more efficient than
ref.get() == obj.
This CL applies the above rule to
RemoteInputConnectionImpl
for a better performance.
This is mechanical refactoring. There must be no observable behavior
change.
Bug: 182259171
Test: presubmit
Change-Id: Iddf73b0fcb16a14f6c024da4a7db136d4fea4900
This is the 5th CL after our CLs [1][2][3][4] for IME visibility
issues.
While the last CL [4] logically reverted most of changes made in
previous CLs [1][2][3], there remain some unintentional changes around
WINDOW_FOCUS_GAIN*. The biggest issue is the invocation of
IMM#mServedInputConnectionWrapper.isActive(),
from startInputOnWindowFocusGain() added in the 3rd CL [3]. This is
really problematic because it internally
IMM#checkFocus(),
which is not intended to be called from startInputOnWindowFocusGain().
This CL addresses that problem by effectively removing the call path.
App compat risk is supposed to be low because IMM#checkFocus() was not
called before the 3rd CL [3], which was introduced in Android R.
There are CTS tests to verify that related issues are not regressed
again [5][6][7].
[1]: I45a9814d812ad906f417c24200fd4219959e2423
6ecbf08772
[2]: I2da99ae67b9ce4051dec0c0f0e975ebe6e1ab118
48bfc3165c
[3]: I1ef3d341af9d473d94d52fd1890deafbae2bc9e1
d43b75cf0e
[4]: I022ad658844142ff4a4cf3b91953013f2bfbb58a
a24622cfcd
[5]: Ie029c109e257be81a1ad6327a706bb6bc1e8316c
3045df602f061a185f6fff18e81f5af1a2c51270
[6]: Id48eedc1a2d5597bbba5f1d3fc01540e2f6de4c5
3ed79ab2de600bce312b4ce59b319da0ad9a8dac
[7]: I022ad658844142ff4a4cf3b91953013f2bfbb58a
a24622cfcd
Bug: 152373385
Bug: 155781821
Bug: 160391516
Bug: 161273049
Bug: 182259171
Test: presubmit
Change-Id: I64412e87c4881018ea67140f9472e10ea41836e4
This is a follow up CL to my previous CL [1], which rewrote
InputMethodManager#isAcceptingText()
with a newly introduced internal method
RemoteInputConnectionImpl#isFinished().
What I overlooked was the fact that
mServedInputConnection.isFinished()
is guaranteed to return "true" while
InputMethodManager#mServedInputConnection
is nonnull. Let's simplify the logic.
This is a safe clean up. There must be no observable behavior change.
[1]: Ic5fbc6213ad62df95fc0b7eef18bab1fd9fbdbf1
d1ff9740c1
Bug: 234882948
Test: presubmit
Change-Id: Icee431b05108aa607ea0a56c683a361399b7583e
Now that
ImeFocusController#onInteractive()
is simple enough to be inlined, which allows us to also remove
InputMethodManagerDelegate#isCurrentRootView().
This is mechanical refactoring. There must be no behavior change.
Bug: 234882948
Test: presubmit
Change-Id: I4f001e7cef6e274a481cd1dc9ce314f3b19313dd
Wrap the createInputConnection logic into a
private method to simplify this complex method.
This is a mechanical restructuring without user
visible changes.
Bug: 236937383
Bug: 236920321
Test: presubmit
Change-Id: I21207d22b7f5d55e84cbfde91969e59bb94b3043
This CL aims to further simplify what MSG_SET_INTERACTIVE handler
needs to do, which was introduced in my previous CL [1].
So redispatching the task to the UI thread is necessary when and only
when "interactive" parameter is true. If it's false, we can directly
invoke DelegateImpl#finishInputAndReportToIme().
[1]: I0c95d7e70357ac98b336cd1b51a7405ba92a9a6f
Bug: 234882948
Test: presubmit
Change-Id: I19e14526a094900c80d9c3fc00f576e3a50cafb2
This is the 6th CL for Bug 26851566 [1][2][3][4][5].
In the CLs [3][5], the approach we took was to extend an existing IPC
method
IInputMethodClient#setActive(boolean active, boolean fullscreen)
by adding one more parameter "reportToImeController".
However, it seems that such an approach made its handling code hard to
maintain, because the IPC method needed to behave in a completely
different manner depending on the newly introduced parameter.
To avoid such a confusion and to make subsequent refactoring easier,
this CL introduces a new IPC method
IInputMethodClient#setInteractive(
boolean interactive, boolean fullscreen)
to clarify what we are actually doing.
In most cases there must be no observable behavior change. One
possible behavior change is when setInteractive() gets called when
IMM#mCurRootView.getView() is not available. In the previous CL, we
fell back to previous behavior as if
FINISH_INPUT_NO_FALLBACK_CONNECTION was not defined. However it looks
like such a fallback mechanism is not an intentional behavior.
The main use case is still verified with existing CTS tests [6][7].
[1]: Ic11956fe745a829da1ec7c09ea214e9b3961c8e0
0df8812486
[2]: If06daf71160aa44a4254ac125561974ecbdef4f2
2c6e80be12
[3]: I8a657e75e274d842fb46b60375f6aeafeab96a59
152eacec4f
[4]: I16f4a34360a2f64b69978724648a9be741f140b5
3d62f739a8
[5]: Id4e71a822bfde5fe6a263bbe094c0d238017efe1
3d62f739a8
[6]: Iba0332ed3b767a9a15768b64947b9cde31105af1
e2f4138156c784746becde6a01c19f0c3de6ac32
[7]: I346ef42f2546a2925bf44ca7719ae19399e15e78
84c5ec2f81d4be5285b9c5f1d0e943f808e9158c
Bug: 26851566
Bug: 156215187
Test: atest InputMethodStartInputLifecycleTest
Change-Id: I0c95d7e70357ac98b336cd1b51a7405ba92a9a6f
This is mechanical refactoring. There must be no observable behavior
change.
Bug: 234882948
Test: presubmit
Change-Id: I0c63504fc7fe665f7b7816bdcc7a6cb357482380
With this CL,
InputMethodManagerDelegate#setCurrentRootView()
will be removed.
This is mechanical refactoring. There must be no observable behavior
change.
Bug: 234882948
Test: presubmit
Change-Id: I3e596b4243f3223d1c9b8ba3571f91879ce0ecd4
This CL inlines
InputMethodManager.DelegateImpl#finishInput().
There must be no observable behavior change except for we no longer
log IME tracing event
"InputMethodManager.DelegateImpl#finishInput".
If that event is turned out to be useful, we can add a similar tag
later, but for now it doesn't look to be critically useful.
Bug: 234882948
Test: presubmit
Change-Id: Ie204f9f665e9ab4814100068ac357fbb4b26b5a5
This CL inlines
InputMethodManager.DelegateImpl#startInput().
There must be no observable behavior change except for we no longer
log IME tracing event
"InputMethodManager.DelegateImpl#startInput".
If that event is turned out to be useful, we can add a similar tag
later, but for now it doesn't look to be critically useful.
Bug: 234882948
Test: presubmit
Change-Id: I15919fba14c3c78d64796c3e600cfd8f62e73133
This is a follow up CL to my previous CL [1], which partly reverted
the initial commit of ImeFocusController [2].
With that CL,
InputMethodManagerDelegate#startInput()
is no longer called. Thus we no longer need to defined it.
There must be no behavior change.
[1]: Ie3446e1d0f62c489195e31fc7f073020884d6cae
ff975479b4
[2]: Ib455704fe1e9d243f93190a84f230210dbceac2a
970d9d2e0c
Bug: 234882948
Bug: 244504062
Test: presubmit
Change-Id: I62ae648b75cc33592e4e985b4c975c97ccdd24f8
Point-based handwriting gestures are supported for points within text
line bounds. With this change, they will also be supported for points
which are outside the line bounds but within a margin of the line bounds.
The margin is added to ViewConfiguration so that the value can be
accessed by other UI toolkits so that they can implement the same
behavior.
The dimension resource is added as a @SystemApi so that OEMs may
override the value.
Bug: 243967209
Test: atest android.widget.cts.TextViewHandwritingGestureTest
Change-Id: I0e64f20c670808580346a485d06a0da0f21d3ed2
Update View#isInTouchMode javadoc according to the new multi-display
touch mode implementation.
Bug: 198499018
Test: m
Change-Id: Idb6cbadd3afd745b76690de67c363749c810f06e
* changes:
BatteryController: Only listen to UEvents from power_supply changes
BatteryController: Remove the /sys prefix when adding UEvent listener
Determine whether an input device supports USI using IDC files