diff options
| author | Jeff Sharkey <jsharkey@android.com> | 2012-05-02 16:12:49 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-05-02 16:12:49 -0700 |
| commit | 9a671137dc95e243009dab34971da75f0d598456 (patch) | |
| tree | 30b45b9311ea93ab117801c5ed6f440b406b0f17 /core/java | |
| parent | 2f612bdfbd7bf94111015d06ba3fa4e864d0972b (diff) | |
| parent | e1d330a071a4574040e6f1147800b4b2c8864043 (diff) | |
Merge "Set tmpdir to application cache directory." into jb-dev
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/app/ActivityThread.java | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index 1a46430bc830..b55ee26a500b 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -3843,7 +3843,7 @@ public final class ActivityThread { windowManager.endTrimMemory(); } - private void setupGraphicsSupport(LoadedApk info) { + private void setupGraphicsSupport(LoadedApk info, File cacheDir) { if (Process.isIsolated()) { // Isolated processes aren't going to do UI. return; @@ -3855,11 +3855,8 @@ public final class ActivityThread { // If there are several packages in this application we won't // initialize the graphics disk caches if (packages != null && packages.length == 1) { - ContextImpl appContext = new ContextImpl(); - appContext.init(info, null, this); - - HardwareRenderer.setupDiskCache(appContext.getCacheDir()); - RenderScript.setupDiskCache(appContext.getCacheDir()); + HardwareRenderer.setupDiskCache(cacheDir); + RenderScript.setupDiskCache(cacheDir); } } catch (RemoteException e) { // Ignore @@ -3925,8 +3922,15 @@ public final class ActivityThread { data.info = getPackageInfoNoCheck(data.appInfo, data.compatInfo); - setupGraphicsSupport(data.info); - + final ContextImpl appContext = new ContextImpl(); + appContext.init(data.info, null, this); + final File cacheDir = appContext.getCacheDir(); + + // 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. @@ -4003,8 +4007,6 @@ public final class ActivityThread { } if (data.instrumentationName != null) { - ContextImpl appContext = new ContextImpl(); - appContext.init(data.info, null, this); InstrumentationInfo ii = null; try { ii = appContext.getPackageManager(). |
