Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f3066d0c authored by Zhi Dou's avatar Zhi Dou Committed by Android (Google) Code Review
Browse files

Merge "Not remove trunk flags when set legacy flags" into main

parents e8e26150 210a4396
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -612,12 +612,19 @@ final class SettingsState {
            String packageName) {
        List<String> changedKeys = new ArrayList<>();
        final Iterator<Map.Entry<String, Setting>> iterator = mSettings.entrySet().iterator();
        int index = prefix.lastIndexOf('/');
        String namespace = index < 0 ? "" : prefix.substring(0, index);
        Map<String, String> trunkFlagMap =
                mNamespaceDefaults.get(namespace);
        // Delete old keys with the prefix that are not part of the new set.
        // trunk flags will not be configured with restricted propagation
        // trunk flags will be explicitly set, so not removing them here
        while (iterator.hasNext()) {
            Map.Entry<String, Setting> entry = iterator.next();
            final String key = entry.getKey();
            final Setting oldState = entry.getValue();
            if (key != null && key.startsWith(prefix) && !keyValues.containsKey(key)) {
            if (key != null && (trunkFlagMap == null || !trunkFlagMap.containsKey(key))
                    && key.startsWith(prefix) && !keyValues.containsKey(key)) {
                iterator.remove();

                FrameworkStatsLog.write(FrameworkStatsLog.SETTING_CHANGED, key,