Skip to content

Bunch together notifications to prevent flickering in UI.

This reverts to the previous behaviour before 8faf151. Then, the InstalledAppProviderService would queue up a series of changes, and only notify after 1 second of nothing being added to the queue. This was good because CursorAdapters and LoaderManagers would not continually requery the database several times a second (only once at the end), but it meant there was a lag in the AppDetails screen getting updated after installing/upgrading/deleting packages.

This restores that behaviour where general events (e.g. "some misc apps in the database were changed") are "debounced" for 1 second. However it also emits a more specific "package org.blah.com was changed" instantly.

In the long term, it would be good to remove any dependency on ContentObservers and notifyChange() altogether, in preference of either LocalBroadcastManager or RxJava. However this will depend on how we go about changing the database layer in the future. The fact we now depend on ContentProviders means that it would be a big change to move away from LoaderManager + notifyChange().

Fixes #986 (closed).

Merge request reports