Loading core/java/android/app/SharedPreferencesImpl.java +4 −2 Original line number Original line Diff line number Diff line Loading @@ -420,13 +420,15 @@ final class SharedPreferencesImpl implements SharedPreferences { for (Map.Entry<String, Object> e : mModified.entrySet()) { for (Map.Entry<String, Object> e : mModified.entrySet()) { String k = e.getKey(); String k = e.getKey(); Object v = e.getValue(); Object v = e.getValue(); if (v == this) { // magic value for a removal mutation // "this" is the magic value for a removal mutation. In addition, // setting a value to "null" for a given key is specified to be // equivalent to calling remove on that key. if (v == this || v == null) { if (!mMap.containsKey(k)) { if (!mMap.containsKey(k)) { continue; continue; } } mMap.remove(k); mMap.remove(k); } else { } else { boolean isSame = false; if (mMap.containsKey(k)) { if (mMap.containsKey(k)) { Object existingValue = mMap.get(k); Object existingValue = mMap.get(k); if (existingValue != null && existingValue.equals(v)) { if (existingValue != null && existingValue.equals(v)) { Loading Loading
core/java/android/app/SharedPreferencesImpl.java +4 −2 Original line number Original line Diff line number Diff line Loading @@ -420,13 +420,15 @@ final class SharedPreferencesImpl implements SharedPreferences { for (Map.Entry<String, Object> e : mModified.entrySet()) { for (Map.Entry<String, Object> e : mModified.entrySet()) { String k = e.getKey(); String k = e.getKey(); Object v = e.getValue(); Object v = e.getValue(); if (v == this) { // magic value for a removal mutation // "this" is the magic value for a removal mutation. In addition, // setting a value to "null" for a given key is specified to be // equivalent to calling remove on that key. if (v == this || v == null) { if (!mMap.containsKey(k)) { if (!mMap.containsKey(k)) { continue; continue; } } mMap.remove(k); mMap.remove(k); } else { } else { boolean isSame = false; if (mMap.containsKey(k)) { if (mMap.containsKey(k)) { Object existingValue = mMap.get(k); Object existingValue = mMap.get(k); if (existingValue != null && existingValue.equals(v)) { if (existingValue != null && existingValue.equals(v)) { Loading