am 41d4332a: Merge "Handle null cache directory" into jb-mr1-dev

* commit '41d4332ab0641d3f5dd2ad8da7e325cd9f81f3c1':
  Handle null cache directory
This commit is contained in:
Amith Yamasani
2012-08-23 10:15:35 -07:00
committed by Android Git Automerger
2 changed files with 9 additions and 5 deletions

View File

@@ -4070,10 +4070,14 @@ public final class ActivityThread {
if (!Process.isIsolated()) {
final File cacheDir = appContext.getCacheDir();
// Provide a usable directory for temporary files
System.setProperty("java.io.tmpdir", cacheDir.getAbsolutePath());
setupGraphicsSupport(data.info, cacheDir);
if (cacheDir != null) {
// Provide a usable directory for temporary files
System.setProperty("java.io.tmpdir", cacheDir.getAbsolutePath());
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

View File

@@ -769,7 +769,7 @@ class ContextImpl extends Context {
}
if (!mCacheDir.exists()) {
if(!mCacheDir.mkdirs()) {
Log.w(TAG, "Unable to create cache directory");
Log.w(TAG, "Unable to create cache directory " + mCacheDir.getAbsolutePath());
return null;
}
FileUtils.setPermissions(