Update System settings content observer to cache values.

Existing ContentObserver will cache values and overwrite
them when the value itself is modified or caller force
updates.

Bug: 149571513
Test: Wrote unit tests, mostly for caching logic.
Not meant to test ContentObserver contract for registering an
observer.

Change-Id: I12835f6c2be27ce17f65a55c51c4ef85c63b4487
This commit is contained in:
Vinit Nayak
2021-02-11 15:48:54 -08:00
parent 8dd4ddc7ae
commit a34af18b0e
12 changed files with 379 additions and 186 deletions

View File

@@ -35,14 +35,14 @@ import androidx.preference.PreferenceViewHolder;
import com.android.launcher3.R;
import com.android.launcher3.notification.NotificationListener;
import com.android.launcher3.util.SecureSettingsObserver;
import com.android.launcher3.util.SettingsCache;
/**
* A {@link Preference} for indicating notification dots status.
* Also has utility methods for updating UI based on dots status changes.
*/
public class NotificationDotsPreference extends Preference
implements SecureSettingsObserver.OnChangeListener {
implements SettingsCache.OnChangeListener {
private boolean mWidgetFrameVisible = false;