Speed up NetworkPolicy thread during user creation
Network Policy Manager makes a ton of calls to UsageStats.isAppIdle, which in turn tries to get the network scorer and results in a lot of calls to PackageManager. Caching the network scorer reduces a lot of the lock contention with PackageManager. Also, caching calls to check for an app's internet permission. Handler for USER_ADDED broadcast reduced in wallclock duration from 2+ seconds to 114ms. Bug: 156582823 Test: atest UserLifecycleTests#createAndStartUser Test: atest AppStandbyTests Change-Id: I369f9c129ca8a13016e00b1bec2776111fa04513
Loading
Please register or sign in to comment