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

Commit f6913597 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

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: Ib261a40619c43f7ea2e686057c0702fb5461d843
parent 0851945a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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>>();
            }