Run PeopleService.onUserUnlocked() on worker thread instead of main thread
This change is targeting on reducing the latency to unlock a user. It includes these changes: (1) In DataManager.onUserUnlocked(), execute the listeners registration code on a worker thread. (2) Merge the usage stats service query and data persistence to one thread. (3) Adjust the query events max age from 1 day to 5 mins because we already persist those events in PeopleService. No need to re-query those events. With this change, PeopleService.onUserUnlocked() execution is reduced from ~200 ms to <1ms. And listeners are set up after conversations being loaded from the disk. This ensures at the events query time (such as UsageStatsService query), all the conversations are already available in People Service to avoid missing some events (events without an associated conversation are dropped). Change-Id: I5248afa2771588a2434c335867de4e2d1a2eb6f3 Test: atest com.android.server.people.data.DataManagerTest Test: atest com.android.server.people.data.ConversationStoreTest Test: atest com.android.server.people.data.PackageDataTest Bug: 150733302
Loading
Please register or sign in to comment