Fix issue #10387684: ArrayIndexOutOfBoundsException in ArrayMap.put
Locking of sSharedPrefs was bad -- it was using a per-context lock instead of a static lock. Change-Id: Ib7a929f9fd93f22cc817d32b53ac56523cdad75f
This commit is contained in:
@@ -710,7 +710,7 @@ class ContextImpl extends Context {
|
||||
@Override
|
||||
public SharedPreferences getSharedPreferences(String name, int mode) {
|
||||
SharedPreferencesImpl sp;
|
||||
synchronized (mSync) {
|
||||
synchronized (ContextImpl.class) {
|
||||
if (sSharedPrefs == null) {
|
||||
sSharedPrefs = new ArrayMap<String, ArrayMap<String, SharedPreferencesImpl>>();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user