Skip to content
Commit 8f35d505 authored by Jeongsik Mun's avatar Jeongsik Mun Committed by Todd Kennedy
Browse files

Avoid running RegisteredServicesCache tasks on main thread

Since RegisteredServicesCache tasks from SyncManager and AccountManager
run on the main thread of SystemServer, It could cause draining
the main thread and end up with ANR when receiving a lot of broadcasts
or notifying changes through a listener.

This CL changes a few things to avoid running it on main thread.
1. RegisteredServicesCache uses BackgroundThread by default for
receiving broadcasts and a listener, instead of main thread.
2. AccountManager uses its own handler for a listener.

Bug: 171907687
Test: atest SyncManagerTest CtsSyncManagerTest AccountManagerServiceTest
Change-Id: I838c15b797b46fd58bb3c6ce9ee444a4737775d8
parent 9995d6ca
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment