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

Commit 4216c3c3 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick Committed by Android Git Automerger
Browse files

am a4682ed7: Merge "Minor SharedPreference clean-up." into gingerbread

Merge commit 'a4682ed7' into gingerbread-plus-aosp

* commit 'a4682ed7':
  Minor SharedPreference clean-up.
parents 681f327e a4682ed7
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -2738,13 +2738,14 @@ class ContextImpl extends Context {
        private final int mMode;

        private Map<String, Object> mMap;     // guarded by 'this'
        private long mTimestamp;  // guarded by 'this'
        private int mDiskWritesInFlight = 0;  // guarded by 'this'
        private boolean mLoaded = false;      // guarded by 'this'
        private long mStatTimestamp;          // guarded by 'this'
        private long mStatSize;               // guarded by 'this'

        private final Object mWritingToDiskLock = new Object();
        private static final Object mContent = new Object();
        private WeakHashMap<OnSharedPreferenceChangeListener, Object> mListeners;
        private final WeakHashMap<OnSharedPreferenceChangeListener, Object> mListeners;

        SharedPreferencesImpl(
            File file, int mode, Map initialContents) {
@@ -2755,7 +2756,7 @@ class ContextImpl extends Context {
            mMap = initialContents != null ? initialContents : new HashMap<String, Object>();
            FileStatus stat = new FileStatus();
            if (FileUtils.getFileStatus(file.getPath(), stat)) {
                mTimestamp = stat.mtime;
                mStatTimestamp = stat.mtime;
            }
            mListeners = new WeakHashMap<OnSharedPreferenceChangeListener, Object>();
        }
@@ -2782,7 +2783,7 @@ class ContextImpl extends Context {
                return true;
            }
            synchronized (this) {
                return mTimestamp != stat.mtime;
                return mStatTimestamp != stat.mtime || mStatSize != stat.size;
            }
        }

@@ -3163,7 +3164,8 @@ class ContextImpl extends Context {
                FileStatus stat = new FileStatus();
                if (FileUtils.getFileStatus(mFile.getPath(), stat)) {
                    synchronized (this) {
                        mTimestamp = stat.mtime;
                        mStatTimestamp = stat.mtime;
                        mStatSize = stat.size;
                    }
                }
                // Writing was successful, delete the backup file if there is one.