Merge "Handle null cache directory" into jb-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
41d4332ab0
@@ -4070,10 +4070,14 @@ public final class ActivityThread {
|
|||||||
if (!Process.isIsolated()) {
|
if (!Process.isIsolated()) {
|
||||||
final File cacheDir = appContext.getCacheDir();
|
final File cacheDir = appContext.getCacheDir();
|
||||||
|
|
||||||
// Provide a usable directory for temporary files
|
if (cacheDir != null) {
|
||||||
System.setProperty("java.io.tmpdir", cacheDir.getAbsolutePath());
|
// Provide a usable directory for temporary files
|
||||||
|
System.setProperty("java.io.tmpdir", cacheDir.getAbsolutePath());
|
||||||
setupGraphicsSupport(data.info, cacheDir);
|
|
||||||
|
setupGraphicsSupport(data.info, cacheDir);
|
||||||
|
} else {
|
||||||
|
Log.e(TAG, "Unable to setupGraphicsSupport due to missing cache directory");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* For system applications on userdebug/eng builds, log stack
|
* For system applications on userdebug/eng builds, log stack
|
||||||
|
|||||||
@@ -769,7 +769,7 @@ class ContextImpl extends Context {
|
|||||||
}
|
}
|
||||||
if (!mCacheDir.exists()) {
|
if (!mCacheDir.exists()) {
|
||||||
if(!mCacheDir.mkdirs()) {
|
if(!mCacheDir.mkdirs()) {
|
||||||
Log.w(TAG, "Unable to create cache directory");
|
Log.w(TAG, "Unable to create cache directory " + mCacheDir.getAbsolutePath());
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
FileUtils.setPermissions(
|
FileUtils.setPermissions(
|
||||||
|
|||||||
Reference in New Issue
Block a user