Only apply flag when it has been changed

The properies object provided in onPropertiesChanged only contains
flag(s) that have been added/deleted/updated, changing an unrelated flag
in the same namespace will trigger onPropertiesChanged to be executed
and the properties object won't have your flag, even though it mighet be
set in deviceconfig.

Test: It builds
Bug: 144693310
Change-Id: Iae1692456266efb860f875f3df33fee5831f60cd
This commit is contained in:
Linus Tufvesson
2019-11-19 12:59:38 +00:00
parent 10197b127a
commit 4e87969a1c

View File

@@ -957,10 +957,12 @@ public class ActivityManagerService extends IActivityManager.Stub
new DeviceConfig.OnPropertiesChangedListener() {
@Override
public void onPropertiesChanged(Properties properties) {
mPssDeferralTime = properties.getLong(ACTIVITY_START_PSS_DEFER_CONFIG, 0);
if (DEBUG_PSS) {
Slog.d(TAG_PSS, "Activity-start PSS delay now "
+ mPssDeferralTime + " ms");
if (properties.getKeyset().contains(ACTIVITY_START_PSS_DEFER_CONFIG)) {
mPssDeferralTime = properties.getLong(ACTIVITY_START_PSS_DEFER_CONFIG, 0);
if (DEBUG_PSS) {
Slog.d(TAG_PSS, "Activity-start PSS delay now "
+ mPssDeferralTime + " ms");
}
}
}
};