
The most expensive part of this whole process is calculating the hash of the whole APK. InstalledAppProvider already caches that, and the rest is OK to query. If any particular part of the query is expensive, it could also be moved to InstalledAppProviderService.