Loading core/java/android/app/ContextImpl.java +8 −3 Original line number Original line Diff line number Diff line Loading @@ -364,7 +364,8 @@ class ContextImpl extends Context { } } Map map = null; Map map = null; if (prefsFile.exists() && prefsFile.canRead()) { FileStatus stat = new FileStatus(); if (FileUtils.getFileStatus(prefsFile.getPath(), stat) && prefsFile.canRead()) { try { try { FileInputStream str = new FileInputStream(prefsFile); FileInputStream str = new FileInputStream(prefsFile); map = XmlUtils.readMapXml(str); map = XmlUtils.readMapXml(str); Loading @@ -377,7 +378,7 @@ class ContextImpl extends Context { Log.w(TAG, "getSharedPreferences", e); Log.w(TAG, "getSharedPreferences", e); } } } } sp.replace(map); sp.replace(map, stat); } } return sp; return sp; } } Loading Loading @@ -2766,12 +2767,16 @@ class ContextImpl extends Context { } } } } public void replace(Map newContents) { /* package */ void replace(Map newContents, FileStatus stat) { synchronized (this) { synchronized (this) { mLoaded = true; mLoaded = true; if (newContents != null) { if (newContents != null) { mMap = newContents; mMap = newContents; } } if (stat != null) { mStatTimestamp = stat.mtime; mStatSize = stat.size; } } } } } Loading Loading
core/java/android/app/ContextImpl.java +8 −3 Original line number Original line Diff line number Diff line Loading @@ -364,7 +364,8 @@ class ContextImpl extends Context { } } Map map = null; Map map = null; if (prefsFile.exists() && prefsFile.canRead()) { FileStatus stat = new FileStatus(); if (FileUtils.getFileStatus(prefsFile.getPath(), stat) && prefsFile.canRead()) { try { try { FileInputStream str = new FileInputStream(prefsFile); FileInputStream str = new FileInputStream(prefsFile); map = XmlUtils.readMapXml(str); map = XmlUtils.readMapXml(str); Loading @@ -377,7 +378,7 @@ class ContextImpl extends Context { Log.w(TAG, "getSharedPreferences", e); Log.w(TAG, "getSharedPreferences", e); } } } } sp.replace(map); sp.replace(map, stat); } } return sp; return sp; } } Loading Loading @@ -2766,12 +2767,16 @@ class ContextImpl extends Context { } } } } public void replace(Map newContents) { /* package */ void replace(Map newContents, FileStatus stat) { synchronized (this) { synchronized (this) { mLoaded = true; mLoaded = true; if (newContents != null) { if (newContents != null) { mMap = newContents; mMap = newContents; } } if (stat != null) { mStatTimestamp = stat.mtime; mStatSize = stat.size; } } } } } Loading