summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2013-07-18 17:31:13 -0700
committerDianne Hackborn <hackbod@google.com>2013-07-18 17:31:13 -0700
commitff32f353f8f6974de80cd6979ce3047dc7133d96 (patch)
treeefae24dfaaf0a107775145fe3efddb5463227713 /core/java
parent059bf080fb29abc7b3fe3e848e68cd105c4f7528 (diff)
downloadframeworks_base-ff32f353f8f6974de80cd6979ce3047dc7133d96.zip
frameworks_base-ff32f353f8f6974de80cd6979ce3047dc7133d96.tar.gz
frameworks_base-ff32f353f8f6974de80cd6979ce3047dc7133d96.tar.bz2
Fix issue #9925269: Naver app crashes on launch
No comment. Change-Id: I084cbbf21cacdce179c11528b7217fdc6006dceb
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/app/ContextImpl.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java
index 6a0fbd5..141d12d 100644
--- a/core/java/android/app/ContextImpl.java
+++ b/core/java/android/app/ContextImpl.java
@@ -16,6 +16,7 @@
package android.app;
+import android.os.Build;
import com.android.internal.policy.PolicyManager;
import com.android.internal.util.Preconditions;
@@ -706,6 +707,16 @@ class ContextImpl extends Context {
sSharedPrefs.put(packageName, packagePrefs);
}
+ // At least one application in the world actually passes in a null
+ // name. This happened to work because when we generated the file name
+ // we would stringify it to "null.xml". Nice.
+ if (mPackageInfo.getApplicationInfo().targetSdkVersion <
+ Build.VERSION_CODES.KEY_LIME_PIE) {
+ if (name == null) {
+ name = "null";
+ }
+ }
+
sp = packagePrefs.get(name);
if (sp == null) {
File prefsFile = getSharedPrefsFile(name);