InstalledAppProviderService to replace InstalledAppCacheUpdater

InstalledAppCacheUpdater was a custom Service-like thing with some
threading issues.  InstalledAppProviderService is an IntentService that
relies on the built-in queue and threading of the IntentService to make
sure that things are processed nicely in the background and one at a time.

This changes the announcing so that each app added/changed/deleted triggers
a new annoucement.  This keeps the UI more updated, and makes the Installed
tab show something as soon as possible, rather than waiting for the all of
the install apps to be processed.  This becomes more important as more
stuff is added to InstalledAppProvider, like the hash of the APK.

This also strips down and simplifies the related BroadcastReceivers.
BroadcastReceivers work on the UI thread, so they should do as little work
as possible. PackageManagerReceiver just rebadges the incoming Intent and
sends it off to InstalledAppProviderService for processing.
This commit is contained in:
Hans-Christoph Steiner
2016-05-27 16:51:35 +02:00
parent 677db72bb3
commit d734e584f6
15 changed files with 270 additions and 534 deletions

View File

@@ -98,6 +98,11 @@ public abstract class ProviderTestCase2MockContext<T extends ContentProvider> ex
public Context getApplicationContext() {
return this;
}
@Override
public String getPackageName() {
return "org.fdroid.fdroid";
}
}
/**