Fixed some missing methods / null pointer exception in applyInternal()

This commit is contained in:
2026-06-07 17:40:41 +01:00
parent 6a9375164c
commit ec5f35b7ee
2 changed files with 7 additions and 3 deletions

View File

@@ -3,7 +3,6 @@ package android.content;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.util.Collections;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
@@ -129,6 +128,8 @@ public class SharedPreferencesImpl implements SharedPreferences {
private static class EditorImpl implements Editor {
private static final Object REMOVED = new Object();
private final SharedPreferencesImpl prefs;
private final Map<String, Object> pendingChanges = new ConcurrentHashMap<>();
private boolean clear = false;
@@ -175,7 +176,7 @@ public class SharedPreferencesImpl implements SharedPreferences {
@Override
public Editor remove(String key) {
pendingChanges.put(key, null); // null means remove
pendingChanges.put(key, REMOVED);
return this;
}
@@ -223,7 +224,7 @@ public class SharedPreferencesImpl implements SharedPreferences {
String key = entry.getKey();
Object value = entry.getValue();
if (value == null) {
if (value == REMOVED) {
prefs.prefs.remove(key);
} else if (value instanceof String) {
prefs.prefs.put(key, (String) value);

View File

@@ -48,6 +48,9 @@ public class CookieManager {
}
}
public void flush() {
}
/**
* Sets a cookie for the given URL.
* Accepts full Set-Cookie style strings (e.g. "name=value; Domain=...; Path=...; Secure; HttpOnly").