diff options
| author | 2024-07-17 05:29:29 +0000 | |
|---|---|---|
| committer | 2024-07-17 05:29:29 +0000 | |
| commit | f48879038dc77c2759fd0966c25936d621942d0c (patch) | |
| tree | 5348e55f115b3e6e067b4d29308d295d848a1ab0 /api/api_test.go | |
| parent | d2715b13c06ec5fb6760537556b12da38bc46092 (diff) | |
Remove ImfLock dependencies from *Repository
This CL reworks how the following two per-user data stores are
guaranteed to be initialized for each user with also making them
independent of ImfLock.
* AdditionalSubtypeMapRepository
* InputMethodSettingsRepository
Here is a quick summary on how the above per-user data stores will be
initialized.
1. IMMS.Lifecycle(Context context) gets called
1.1 InputMethodManagerService is initialized
1.2 IMMS.Lifecycle#initializeUsersAsync() is called for existing
users, which initializes the above two data stores in the
I/O thread.
2. IMMS.Lifecycle#onBootPhase(int phase) gets called for
PHASE_ACTIVITY_MANAGER_READY
2.1 IMMS#systemRunning() first calls #waitForUserInitialization()
to make sure that initializeUsersAsync() is completed with
a certain timeout (3 sec).
2.2 IMMS#systemRunning() starts tasks with an assumption that the
above per-user data stores are initialized.
Here are useful guarantees we can start relying on with this CL.
* AdditionalSubtypeMap#load() is guaranteed to be called only once
for each user on the I/O thread without ImfLock.
* When IMMS#systemRunning() is running *Repository are already
initialized (unless it's timed out).
This CL should improve the resource utilizations during boot time
without changing the observable semantics.
Bug: 343601565
Fix: 352354308
Test: presubmit
Test: manually verified by checking logcat
Flag: EXEMPT refactor
Change-Id: I4400519f133638c03205f7a8902f7e00c291eda8
Diffstat (limited to 'api/api_test.go')
0 files changed, 0 insertions, 0 deletions