summaryrefslogtreecommitdiff
path: root/api/api_test.go
diff options
context:
space:
mode:
author Yohei Yukawa <yukawa@google.com> 2024-07-31 14:17:20 -0700
committer Yohei Yukawa <yukawa@google.com> 2024-07-31 14:17:20 -0700
commit91a851e48afadff1ded825ae6e93906d10df99b0 (patch)
treeb44c904bf43354418966d05d2b6654d245ee7f4c /api/api_test.go
parent5a1286dc760a93c7d16c770605112181e49377e4 (diff)
Minimize invocations of queryIntentServices() in IMMS
This CL reworks how updates on user locking state and additional subtypes are reflected into the InputMethodSettingsRepository. Previously we have called InputMethodManagerService#queryInputMethodServicesInternal() in a relatively ad-hoc manner, meaning that we have called it whenever we need a new InputMethodMap that is different from the one stored in InputMethodSettingsRepository. With this CL UserData#mRawInputMethodMap keeps track of the raw results of Context#queryIntentServices() for both direct-boot aware IMEs and direct-boot unaware IMEs in a form that additional subtypes are not yet taken into account. The cache allows us to reconstruct the required InputMethodMap on the fly without calling Context#queryIntentServices() again. This is a huge win in terms of both performance and code simplicity. For instance, the following IME APIs no longer need to rely on Context#queryIntentServices() internally, which means that these APIs will return much sooner than before, and more importantly without depending on ActivityManagerService global lock. * InputMethodManager#setAdditionalInputMethodSubtypes() * InputMethodManager#getInputMethodListAsUser() with DirectBootAwareness.ANY Overall there should be no observable behavior change, and wxisting end-to-end CTS tests should verify such expectations. Fix: 354256119 Test: atest CtsInputMethodTestCases Test: atest CtsInputMethodInstallTestCases Test: atest FrameworksInputMethodSystemServerTest Flag: EXEMPT refactor Change-Id: I4cb07b0c776143b2f477ef8bb383ad4e0ed0b204
Diffstat (limited to 'api/api_test.go')
0 files changed, 0 insertions, 0 deletions