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

Commit f02069cd authored by Songchun Fan's avatar Songchun Fan Committed by Song Chun Fan
Browse files

[SettingsProvider] fix configs cache update

The bug is that after remove(), size() changed during for loop, leaving
some obsolete keys in the cache.

BUG: 276881870
Test: atest android.deviceconfig.cts.DeviceConfigApiTests
Change-Id: I9aa5152caa454c4923429168469ae3a13b05b9ae
parent d765772c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3431,7 +3431,7 @@ public final class Settings {
                                    + " type:" + mUri.getPath()
                                    + " in package:" + cr.getPackageName());
                        }
                        for (int i = 0; i < mValues.size(); ++i) {
                        for (int i = mValues.size() - 1; i >= 0; i--) {
                            String key = mValues.keyAt(i);
                            if (key.startsWith(prefix)) {
                                mValues.remove(key);