Do not load xml metadata for unchanged packages in RegisteredServicesCache
RegisteredServicesCache caches services in an xml, so the system doesn't have to scan all the apks. Whenever a package is changed (add/remove/replaced), the broadcast receiver in RegisteredServicesCache will refresh this cache by quering all matching services and reading their xml metadata. There is extra work done here, because only the changed package will have services added/removed. The edge case is after a cache is invalidated, we want to query package manager for everything, regardless of what changedUids is (we could have arrived here if invalidateCache is called, and then a package change event fires, before a getAllServices is called to rescan everything). Add a new test to verify that the optimization takes care of the case when the cache is invalidated. Bug: 117755076 Bug: 122912184 Test: atest RegisteredServicesCache Test: dumpsys content # check sync adapters Merged-In: I5c1f57108c4b67d24b198000d57216c63d35290a Change-Id: I5c1f57108c4b67d24b198000d57216c63d35290a
Loading
Please register or sign in to comment