Wait 3 seconds before refreshing the view.

With a 1 second debounce, I was getting the view to refresh
several times in response to large apps being processed (e.g.
Firefox, OSMAnd, etc). This was on a (relatively) recent Moto X
2nd Gen, so it would be even more visible on an older device.

The side effect of updating frequently is that the main list
of apps flashes regularly in front of the user (see #986).

This "update the view" is only in response to a background
task that is expected to take several seconds (e.g. 30 seconds)
anyway, so waiting 3 seconds instead of 1 is not particularly
problematic.
This commit is contained in:
Peter Serwylo 2017-06-08 09:12:52 +10:00
parent 1dbf5704b6
commit 9e33dcf0db

View File

@ -73,7 +73,7 @@ public class InstalledAppProviderService extends IntentService {
// the list of installed apps and insert them to the database...
packageChangeNotifier
.subscribeOn(Schedulers.newThread())
.debounce(1, TimeUnit.SECONDS)
.debounce(3, TimeUnit.SECONDS)
.subscribe(new Action1<String>() {
@Override
public void call(String packageName) {