Onl apply flag when it has been changed

The properies object provided in onPropertiesChanged only contains
flag(s) that have been added/deleted/updated.

Bug: 144693310
Test: atest AppsFilterTest
Change-Id: I8b9f90efff83da367189c9b218251c4d777afcee
This commit is contained in:
Linus Tufvesson
2019-12-05 16:15:10 +00:00
parent 0715e47f92
commit 87776d6687

View File

@@ -136,8 +136,11 @@ public class AppsFilter {
DeviceConfig.addOnPropertiesChangedListener(
NAMESPACE_PACKAGE_MANAGER_SERVICE, FgThread.getExecutor(),
properties -> {
synchronized (FeatureConfigImpl.this) {
mFeatureEnabled = properties.getBoolean(FILTERING_ENABLED_NAME, false);
if (properties.getKeyset().contains(FILTERING_ENABLED_NAME)) {
synchronized (FeatureConfigImpl.this) {
mFeatureEnabled = properties.getBoolean(FILTERING_ENABLED_NAME,
false);
}
}
});
}