History log of /frameworks/base/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeIInputMethodManager.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
833bdcedceee60a873694a77587393abfc830eb5 16-May-2016 Yohei Yukawa <yukawa@google.com> Make IMS#clearInsetOfPreviousIme() reliable.

This is a follow-up to my previous CL [1] for Bug 15922840 so that we
can clear the following variables in a more reliable way.
- PhoneWindowManager#mLastInputMethodWindow
- PhoneWindowManager#mLastInputMethodTargetWindow

The idea behind CL [2] is that when InputMethodManagerService (IMMS) is
switching from an IME to another IME, IMMS can send a signal to
WindowManagerService (WMS) to remember the current IME's inset so that
the system can continue using it to reduce jank until the new inset is
specified by the next IME. As summarized in Bug 28781358, however, if
the next IME does not show the window after the IME switch, WMS (or
PhoneWindowManager to be precise) keeps using the previous IME's inset
unexpectedly until the new IME shows its window. All we have seen in
Bug 15922840 and Bug 26663589 fall into this category.

The idea of this CL is just adding a hidden API to InputMethodManager so
that InputMethodService#clearInsetOfPreviousIme() can surely terminate
the IME transition state managed in PhoneWindowManager, rather than
relying on a hack of calling SoftInputWindow#show() and
SoftInputWindow#hide(), which actually does not work for Bug 26663589.

[1]: Ib04967f39b2529251e4835c42e9f99dba2cf43f2
2977eb7b6ce82309a1bb1ba4ab698f503cb0388a
[2]: I5723f627ce323b0d12bd7b93f5b35fc4d342b50c
792faa2c16d319e874a1d633f964a78266d5f3f2

Note that addressing all the corner cases in [2] still requires lots of
non-trivial change. Hence this CL focuses only on Bug 26663589 (and
the case we handled in Bug 15922840).

Bug: 26663589
Change-Id: Ib567daa009c1139858dccadcfc6a04465ebecf36
/frameworks/base/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeIInputMethodManager.java
19a80a1e807acd00bec999eaac7812da6ffce954 15-Mar-2016 Yohei Yukawa <yukawa@google.com> Tell IMS about missing InputConnection methods.

Summary:
This CL introduces a unified mechanism to deal with the situation
where the application directly implements InputConnection but some of
methods are not implemented. Note that there should be zero overhead
when the application extends BaseInputConnection or
InputConnectionWrapper.

Background:
When ever we add a new method to InputConnection, there has been a
risk that existing applications that directly implement
InputConnection can get java.lang.AbstractMethodError exception at
runtime, because older SDKs do not require the application developer
to implement the methods that are newly added in later SDKs. Because
of this we strongly discouraged developers to directly implement
InputConnection interface, and encouraged them to subclass
BaseInputConnection or InputConnectionWrapper instead. That said, as
requested in Bug 26945674, there is a certain demand to be able to
implement InputConnection without depending on BaseInputConnection.
The goal of this CL is to provide a reliable and sustainable solution
to above missing method scenario in InputConnection.

One of the reasons why dealing with missing InputConnection methods is
so difficult is that what InputMethodService receives to communicate
with the target application is actually a proxy class
com.android.internal.view.InputConnectionWrapper
that runs in the IME process and immediately returns true for most of
methods in InputConnection such as #commitText() and
#finishComposingText(). Because of this asynchronous nature, it is
too late to change the actual return value that the IME receives when
the application receives those one-way asynchronous IPC calls.

Solution:
To handle those cases, this CL checks the availability of
InputConnection methods that did not exist in the initial release
before the target application calls startInput(), and let the
application to send its availability bits to IMMS so that
InputConnectionWrapper running in the IME process can be initialized
with such availability bits. Note that we do know that
BaseInputConnection and its subclasses support all the InputConnection
methods, hence for most of applications we can just assume that all
the methods are available without reflection.

With such availability bits, InputConnectionWrapper is now able to
gracefully return failure code to the IME because the availability of
those methods is immutable, except for a tricky case where the
application relies on a proxy object that dynamically changes the
dispatch target.

Here is the list of APIs that we start checking the availability in
this CL.
[API Level 9+]
- InputConnection#getSelectedText(int)
- InputConnection#setComposingRegion(int, int)
[API Level 11+]
- InputConnection#commitCorrection(CorrectionInfo)
[API Level 21+]
- InputConnection#requestCursorUpdates(int)}
[API Level 24+]
- InputConnection#deleteSurroundingTextInCodePoints(int, int)
- InputConnection#getHandler()

Ideas alternatively considered: Default methods in InputConnection
We once considered having default methods in InputConnection but
abandoned this idea because it does not directly solve the problem
about how to tell the that the API does not take effect.
Also having default methods would make it difficult for application
developers to be aware of newly added methods in InputConnection.

Bug: 27407234
Bug: 27642734
Bug: 27650039
Change-Id: I3c58fadd924fad72cb984f0c23d3099fd0295c64
/frameworks/base/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeIInputMethodManager.java
5cf733f89b4016aecc3b96e2a72e98b2a571aeb8 23-Feb-2016 Yohei Yukawa <yukawa@google.com> Fix build breakage.

This follows up to my previous CL [1], which forgot to update
BridgeIInputMethodManager.java (again!).

[1] I56934f18e30d90fcdf77bcbb0c35a92a5feb1b82
05c25f8a3a033816ac25aa5cd7db5b1ab495bc3f

Bug: 25373872
Change-Id: I0643069fd0b677115c89c340b7a23f1d12bd7988
/frameworks/base/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeIInputMethodManager.java
c428d4742d51440012c08174630b5ae28c20c15f 25-Nov-2015 Yohei Yukawa <yukawa@google.com> Fix build breakage in BridgeIInputMethodManager.

This is a follow up CL for 35d3f37bd51268cc99d81a3f537ac364d178e851 [1],
which changed some method signatures of IInputMethodManager.

[1]: Ia1fe120af7d71495c5f3a4fc0ec6390efb8240ca

We need to update BridgeIInputMethodManager.java every time when we
change IInputMethodManager.

Bug: 25373872
Change-Id: I126dc4234f921039a9d29010ea411a0a7d2ef6c6
/frameworks/base/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeIInputMethodManager.java
14e139179be7daab6ed452105387a3922752c219 07-May-2015 Seigo Nonaka <nona@gogole.com> Retry "Always show auxiliary subtypes from NavBar keyboard icon."

This CL relands I1e50ee42838a1bf64a612da4904aa93458d44ea4, which was
reverted by I3decaf37198e5864a1763a059df4a36ebc70c5a7 due to the build
breakage in 'layoutlib' target, with a proper fix.

Hereafter the original CL description is repeated.

The auxiliary subtypes should be listed if the input method picker is
opened from NavBar keyboard icon. However there is only
IMM#showInputMethodPicker() API to open input method picker and this is
also used from LockScreen or Settings UI. Auxiliary subtypes should not
be listed there(Id7cf5d122). Thus framework shows auxiliary subtypes
based on IMMS#mInputShown and LockScreen state, but it is not a perfect
solution. If a physical keyboard is connected, the soft input may be
gone. As the result, auxiliary subtypes won't be listed even if it is
opened from NavBar keyboard icon.

To fix this issue, this CL introduces IMM#showInputMethodPicker(boolean)
to be able to decide showing auxiliary subtypes by caller.
Note that IMM#showInputMethodPicker(boolean) is still hidden with @hide.
There is no public API change in this CL.

Bug: 20763994
Change-Id: Id156c85535a221235737ea6dcc15a67f1c4b9f71
/frameworks/base/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeIInputMethodManager.java
69684533cded9923e98789694dea4dd36ace9fab 11-Jul-2014 Yohei Yukawa <yukawa@google.com> Fix SDK build breakage

This should have been included in I3c6b69bd9d79b199afe68d838f25effa6

BUG: 15812658
BUG: 16118603
Change-Id: I298206008fc28faa4f6576a77d56251f873f233c
/frameworks/base/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeIInputMethodManager.java
3d1e8129ebd69db49d80e5d598f608c59b884cdf 06-Jun-2014 Yohei Yukawa <yukawa@google.com> Introduce a sequence number to avoid redundant IPCs

This CL introduces a sequence number to avoid redundant IPCs
between IMM and IMMS. The basic concept is that:
1. IMMS maintains a sequence number for #notifyUserAction.
2. IMMS increases the sequence number whenever the current
IME/subtype is changed.
3. IMMS notifies the new sequence number to IMM.
4. IMM maintains the last sent sequence number and the next
sequence number. IMM should call #notifyUserAction only
once per particular sequence number.
5. IMMS ignores #notifyUserAction if the specified sequence
number is not the expected one.

BUG: 7043015
Change-Id: I19ad8542659bc092b92ee13eb9f1d68ddd4b815a
/frameworks/base/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeIInputMethodManager.java
0297051162193ef2b7d906409868e404f77e4c31 05-Jun-2014 Yohei Yukawa <yukawa@google.com> Trivial method renaming for notifyTextCommitted

This CL does not change existing behavior but only renames
notifyTextCommitted with notifyUserAction so that we can use
not only text commit but also other actions such as just typing
a character will be used as a trigger to update the IME
rotation order for better IME switching experience.

BUG: 7043015
Change-Id: I7f3e13a7226ef0dceee82b67e8a0d8536f7e9807
/frameworks/base/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeIInputMethodManager.java
ff0bb30752339046586ec7c495c53a7ae2cf29df 08-Apr-2014 Ying Wang <wangying@google.com> Fix sdk build.

Change-Id: I3e620315e082b46ba5fcd4511b9c258bf610ddf5
/frameworks/base/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeIInputMethodManager.java
6fbaf6cfd8c85984c75ca2ef8c1dc8bde844bb07 21-Oct-2013 Satoshi Kataoka <satok@google.com> Update a test corresponding to I11ed9a767588f808

Change-Id: Ic802c075390f11fa4a5c14b8397a045b2dfec75c
/frameworks/base/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeIInputMethodManager.java
f314dc01210d117959ae2a303d0311cd071ee927 15-Oct-2013 Satoshi Kataoka <satok@google.com> Update tests corresponding to I0e920ee79c526c3ae

Bug: 11035379
Bug: 5137498

Change-Id: Ief2a151bd83b75bf5b07d53b190a61f341541a21
/frameworks/base/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeIInputMethodManager.java
282e181b58cf72b6ca770dc7ca5f91f135444502 24-Jan-2014 Adam Lesinski <adamlesinski@google.com> Revert "Move frameworks/base/tools/ to frameworks/tools/"

This reverts commit 9f6a119c8aa276432ece4fe2118bd8a3c9b1067e.
/frameworks/base/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeIInputMethodManager.java
9f6a119c8aa276432ece4fe2118bd8a3c9b1067e 28-Aug-2013 Mike Lockwood <lockwood@google.com> Move frameworks/base/tools/ to frameworks/tools/

Change-Id: I3ffafdab27cc4aca256c3a5806b630795b75d5c8
/frameworks/base/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeIInputMethodManager.java
85cac210dd70dd49fcba57d790c2c390e8e61810 23-Aug-2013 satok <satok@google.com> Fix test breakage

Change-Id: I0b2b7ce4b9f50910b4795cb480aa86a662b16f7d
/frameworks/base/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeIInputMethodManager.java
b3c21ac7c661022534135bf688a75ec35fe3a8f2 07-Aug-2013 Satoshi Kataoka <satok@google.com> Reduce the transaction fee of getEnabledInputMethodSubtypeList

Bug: 8467480
Change-Id: If18cce8fbe567df51f29adcdcedff3f743460b8b
/frameworks/base/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeIInputMethodManager.java
cb581bbe2e1fd2a55b70a516fbaac53da0108c28 25-Feb-2012 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of 34706a4c to master

Change-Id: I4dd24f3b917aa7e3d2c4b0fae51e951dfcf88ba8
b69b2c01b4de8a161d6c39e7428ffd25c36eb8cc 25-Feb-2012 Dianne Hackborn <hackbod@google.com> Fix build.

Change-Id: Id3262bff0df598ecc81a4346dee9febd3aaa60c9
/frameworks/base/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeIInputMethodManager.java
688bd47fccf1a1373e6287bc49b5b33fad12b7f3 09-Feb-2012 satok <satok@google.com> Add an api to switch to the next IME and subtype

Bug: 5975302

Change-Id: I48aa4220159c65f456d61a324efcdf0a1ceec91c
/frameworks/base/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeIInputMethodManager.java
46d43ccfd8cef75b4315828073c094cf1efb05ff 03-Feb-2012 Xavier Ducrohet <xav@android.com> Make Layoutlib compile on Java 6.

Change-Id: Ic8f0e321c6c218de83664fc01f253a07fa80852c
/frameworks/base/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeIInputMethodManager.java
ee5e77cafec2eae70890abdcc1646ed39b06eddd 02-Sep-2011 satok <satok@google.com> Make setAdditionalInputMethodSubtypes async

Bug: 5120261
Change-Id: Ic7869cfaa5361531e08d58d7dfa5ba0feab0613e
/frameworks/base/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeIInputMethodManager.java
af64556de0064eeb5a4d4e6d634c3f074f5f40ce 20-Jul-2011 Xavier Ducrohet <xav@android.com> Layoutlib: misc fix + start of AndroidBidi support.

Change-Id: If2ce0b683da8cce01679322d503eed8dd474e521
/frameworks/base/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeIInputMethodManager.java
91e88122cf28a48fd2e2260da7d3d87dd437227a 18-Jul-2011 satok <satok@google.com> Enable IMEs to set additional subtypes in background

Bug: 4591792

Change-Id: I7e61a576c56d1a3a56001bdf2fd51ad3801add01
/frameworks/base/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeIInputMethodManager.java
96131eef3869f2be1300e1620f5c3874b41bb534 12-Jul-2011 Xavier Ducrohet <xav@android.com> LayoutLib: updated fake accessbility manager and ensure there's an InputMethodManager

We had replaced the accessibility Manager but it lacked some new API. Obvisouly
this is fragile and should be fixed, but this works for now.

After fixing this there was another issue with the lack of InputMethodManager.
To fix this I had to create an implementation of IInputMethodManager which
normally comes from a binder object.

I may want to do a similar trick with the accessibility manager later.

Change-Id: I28c6494e333f39072f348d0199124efac93256a5
/frameworks/base/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeIInputMethodManager.java