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

Commit b1104b37 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick Committed by Android (Google) Code Review
Browse files

Merge "Make SharedPreferencesBackupHelper wait for async SharedPreference writes" into gingerbread

parents 745e751b 6f9d58ac
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.app.backup;

import android.app.QueuedWork;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.ParcelFileDescriptor;
@@ -95,6 +96,10 @@ public class SharedPreferencesBackupHelper extends FileBackupHelperBase implemen
            ParcelFileDescriptor newState) {
        Context context = mContext;

        // If a SharedPreference has an outstanding write in flight,
        // wait for it to finish flushing to disk.
        QueuedWork.waitToFinish();

        // make filenames for the prefGroups
        String[] prefGroups = mPrefGroups;
        final int N = prefGroups.length;
@@ -123,4 +128,3 @@ public class SharedPreferencesBackupHelper extends FileBackupHelperBase implemen
        }
    }
}