OSDN Git Service

Don't create cache directory for isolated processes
authorAmith Yamasani <yamasani@google.com>
Sat, 18 Aug 2012 01:00:52 +0000 (18:00 -0700)
committerAmith Yamasani <yamasani@google.com>
Sat, 18 Aug 2012 01:01:24 +0000 (18:01 -0700)
They don't have access anyway
This makes Chrome work in secondary users

Change-Id: I4d30581bc6e807901e642893d6964854c0567fec

core/java/android/app/ActivityThread.java

index 7eb86f4..0438e77 100644 (file)
@@ -4055,13 +4055,14 @@ public final class ActivityThread {
 
         final ContextImpl appContext = new ContextImpl();
         appContext.init(data.info, null, this);
-        final File cacheDir = appContext.getCacheDir();
+        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);
+            // Provide a usable directory for temporary files
+            System.setProperty("java.io.tmpdir", cacheDir.getAbsolutePath());
 
+            setupGraphicsSupport(data.info, cacheDir);
+        }
         /**
          * For system applications on userdebug/eng builds, log stack
          * traces of disk and network access to dropbox for analysis.