Fix ANRs caused by ApplicationsProvider

Before, ApplicationsProvider rebuilt the whole in-memory apps database
every time any package was added, changed or removed. This caused
it to use a lot of CPU and lock a lot of shared resources, blocking
other, potentially higher-priority threads.

In this change, ApplicationsProvider builds its DB on first start,
and then only does incremental updates for the apps that have been
added/changed/removed.

Fixes (hopefully) http://b/issue?id=2261743
1 file changed
tree: 1a0e54b663c402c7cfa05d4ffbea438e44062627
  1. res/
  2. src/
  3. Android.mk
  4. AndroidManifest.xml
  5. MODULE_LICENSE_APACHE2
  6. NOTICE