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

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

Fix IME list corruption upon IMM#setAdditionalInputMethodSubtypes

This is a follow up CL to my previous CL [1], which introduced a
tricky bug where InputMethodManagerService may look to forget certain
IMEs when an IME calls IMM#setAdditionalInputMethodSubtypes() API.

The issue is that when an IME X calls

  InputMethodManagerService#setAdditionalInputMethodSubtypes(),

IMMS stops recogning IMEs that are not visible from IME X. This
happens because InputMethodSettings for the calling user will be
replaced with

  packageManager.queryIntentServices(
    new Intent(InputMethod.SERVICE_INTERFACE),
    PackageManager.GET_META_DATA
    | PackageManager.MATCH_DIRECT_BOOT_AUTO
    | PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS);

where package visibility filtering will be applied with IME X's
identity rather than system_server's identity.

With this commit we start calling packageManager#queryIntentServices()
with system_server's identity as it used to be before my commit [1].

See also the corresponding regression test [2].

 [1]: If7d9dc5636f1bf04f02a18c84d55681914e82014
      43198777
 [2]: I25245a48088c8dd75affc1e68e174a8f8af0d189

Bug: 343108534
Fix: 335281466
Fix: 339928613
Fix: 340806169
Fix: 342105635
Fix: 339912139
Test: atest CtsInputMethodTestCases:InputMethodSubtypeEndToEndTest
Change-Id: I3ea4e233202f8b77b8162a743f1ffedff9abb4af
parent 6203f2d0
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