Optimize getCarrierServicePackageName in CarrierPrivilegesTracker
The original implementation will always query package manager which is pretty heavy operation and prone to deadlock. This CL optimizes the method with paths below: - Return cache if present - Perform light query on install packages for services only - Perform original heavy query as before as the last resort In majority of the cases, the cache is returned and this should largely improve the performance of the method and reduce the risk for deadlock or IPC thread blocking. Bug: 217442920 Test: atest CarrierPrivilegesTrackerTest Change-Id: I2163fac6c371a706e565050ea6ad066cbca8f588 Merged-In: I2163fac6c371a706e565050ea6ad066cbca8f588 (cherry picked from commit bcf5d849)
Loading
Please register or sign in to comment