9 Commits

Author SHA1 Message Date
Yohei Yukawa
419b1b0498 Make a copy of Matrix in CursorAnchorInfoBuilder
This CL fixes a bug that CursorAnchorInfoBuilder does't make a
copy if the Matrix specified with #setMatrix.

Without this fix, IMM#updateCursorAnchorInfo could fail to detect
duplicated events when the same instances of
CursorAnchorInfoBuilder and Matrix are reused to optimize
performance.

Change-Id: I50c50a12a06d3cda4dec445b171b61ceb78da21a
2014-05-15 16:10:04 +09:00
Yohei Yukawa
81f4cb3f85 Enable CursorAnchorInfo to contain composing string
This CL adds one more functionality to CursorAnchorInfo
that enables applications to associate the composition
string with its positional information. This is useful
for an IME to handle CursorAnchorInfo asynchronously.

This is also useful for the framework to detect if
the application is unnecessarily calling
IMM#updateCursorAnchroInfo with duplicate event.

BUG: 14579622
Change-Id: Ie75c17b523dad33e97b08c15f5f5267573ce2063
2014-05-14 19:28:59 +09:00
Yohei Yukawa
c2ddd60236 Introduce new API for floating window support
This CL introduces a new API IMM#updateCursorAnchorInfo for
floating window support.

BUG: 14579622
Change-Id: I61dec2f8fa671ba891da1d4af08975750e3acb04
2014-05-09 19:17:15 +09:00
Yohei Yukawa
a1223cfe6f Take supportsSwitchingToNextInputMethod into considertaion
With this CL, InputMethodManager#switchToNextInputMethod starts
behaving as if there are two rotation groups: one is for the new
input methods that are declared with
supportsSwitchingToNextInputMethod set to true to indicate they
have some language switching UI, and the other is for the other
input methods to preserve the existing behavior.

In addition to the above change, this CL also fixes the behavior
of InputMethodManager#shouldOfferSwitchingToNextInputMethod()
so as to return true if and only if the former rotation group
consists of two or more input methods, as originally designed.

BUG: 12981505
Change-Id: I84291fd4a7d6192b3bd0c366c49586e79135584f
2014-05-01 22:52:16 +09:00
Yohei Yukawa
d1da115298 Add unit tests for InputMethodSubtypeSwitchingController
This CL adds unit tests for InputMethodSubtypeSwitchingController
as a ground work to make it aware of
supportsSwitchingToNextInputMethod in a subsequent CL.

This CL never changes existing behavior.

BUG: 12981505
Change-Id: I3b2c46c47c7686b811fa248ad549f20875367425
2014-05-01 19:13:25 +09:00
Yohei Yukawa
f06569561f Introduce InputMethodSubtypeArray for memory efficient IPCs
This CL introduces InputMethodSubtypeArray which compresses
multiple instances of InputMethodSubtype to reduce the risk
of TransactionTooLargeException during IPCs.

There are some IMEs which rapidly adding new subtypes into
their supported language list. One problem here is that each
instance of InputMethodInfo internally owns the list of
supported subtypes. Basically it requires additional
200 ~ 300 bytes for each subtype when InputMethodInfo is
transffered via IPCs. We should keep the size less than
100 KB in typical scenario.

With this CL, the list of InputMethodSubtype is marshalled
with GZIP compression. Approximately one InputMethodInfo is
marshalled within 10 KB even when it has 100 subtypes.

No negative performance impact is observed so far. The cost of
decompression seems to be compensated by another optimization
in this CL. Actually marshalling cost is reduced with this CL
by caching the compressed data on demand.

BUG: 12954290
Change-Id: Ibb2940fcc02f3b3b51ba6bbe127d646fd7de7c45
2014-03-06 11:25:57 +09:00
Yohei Yukawa
c18cd393f6 Make sure InputMethodInfo implements Parcelable transitively
This CL adds one more test to make sure InputMethodInfo
implements Parcelable correctly. This test makes sure that
one can marshall and unmarshall again from an unmarshalled
copy of InputMethodInfo.

BUG: 12954290
Change-Id: I5aa1552a8089fe0bac54513ba224e5bfc494be97
2014-03-03 14:14:10 +09:00
Yohei Yukawa
589800485d Add unit test for InputMethodInfo
This CL adds a unit test to make sure that InputMethodInfo
implements Parcelable correctly.

BUG: 12954290
Change-Id: I0abe8c266b4b035bf8ef4688d11069b355fabe9f
2014-02-27 17:32:48 +09:00
Satoshi Kataoka
f1367b7e90 Do not turn on imes unexpectedly with unit tests
Bug: 7872918

Change-Id: Ie1d74c9fac27de140e7aa85f2eaefcb89aa06ea7
2013-01-28 19:25:55 +09:00