Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit ddad4b93 authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Simplify the constructor of InputMethodInfo

This is a preparation CL for fixing Bug 32343335, where we aim to
avoid unnecessary reconstruction of InputMethodInfo objects by caching
immutable part of those metadata by APK revisions.

The reason why we have had to pass additional subtypes not just as
List<InputMethodSubtype> but as Map<String, List<InputMethodSubtype>>
to create an instance of InputMethodInfo is that how to compute
so-called IME ID is not exposed from InputMethodInfo even as @hide
method.

In practice it has been calculated as
  new ComponentName(packageName, serviceName).flattenToShortString()
and those IDs are already stored here and there including secure
settings.  It is almost impossible to change the rule anymore hence
we should consider them to be a kind of public API.

This CL adds a @hide static method InputMethodInfo#computeId() to
make it clear.  This also enables us to simplify the constructor
of InputMethodInfo finally, because we have used IME IDs as keys
in subtypes.xml, where additional subtypes are stored.

Test: Manually verified that addtional subtypes still work
Test: checkbuild
Bug: 32343335
Change-Id: I1deaa470e042eac749e7a847933d14448a0d9e03
parent 82c8e5c9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment