Loading core/java/android/app/ActivityThread.java +7 −1 Original line number Original line Diff line number Diff line Loading @@ -6299,7 +6299,13 @@ public final class ActivityThread extends ClientTransactionHandler { final File cacheDir = context.getCacheDir(); final File cacheDir = context.getCacheDir(); if (cacheDir != null) { if (cacheDir != null) { // Provide a usable directory for temporary files // Provide a usable directory for temporary files System.setProperty("java.io.tmpdir", cacheDir.getAbsolutePath()); String tmpdir = cacheDir.getAbsolutePath(); System.setProperty("java.io.tmpdir", tmpdir); try { android.system.Os.setenv("TMPDIR", tmpdir, true); } catch (ErrnoException ex) { Log.w(TAG, "Unable to initialize $TMPDIR", ex); } } else { } else { Log.v(TAG, "Unable to initialize \"java.io.tmpdir\" property " Log.v(TAG, "Unable to initialize \"java.io.tmpdir\" property " + "due to missing cache directory"); + "due to missing cache directory"); Loading core/tests/coretests/src/android/app/activity/ActivityThreadTest.java +5 −0 Original line number Original line Diff line number Diff line Loading @@ -87,6 +87,11 @@ public class ActivityThreadTest { new ActivityTestRule<>(TestActivity.class, true /* initialTouchMode */, new ActivityTestRule<>(TestActivity.class, true /* initialTouchMode */, false /* launchActivity */); false /* launchActivity */); @Test public void testTemporaryDirectory() throws Exception { assertEquals(System.getProperty("java.io.tmpdir"), System.getenv("TMPDIR")); } @Test @Test public void testDoubleRelaunch() throws Exception { public void testDoubleRelaunch() throws Exception { final Activity activity = mActivityTestRule.launchActivity(new Intent()); final Activity activity = mActivityTestRule.launchActivity(new Intent()); Loading Loading
core/java/android/app/ActivityThread.java +7 −1 Original line number Original line Diff line number Diff line Loading @@ -6299,7 +6299,13 @@ public final class ActivityThread extends ClientTransactionHandler { final File cacheDir = context.getCacheDir(); final File cacheDir = context.getCacheDir(); if (cacheDir != null) { if (cacheDir != null) { // Provide a usable directory for temporary files // Provide a usable directory for temporary files System.setProperty("java.io.tmpdir", cacheDir.getAbsolutePath()); String tmpdir = cacheDir.getAbsolutePath(); System.setProperty("java.io.tmpdir", tmpdir); try { android.system.Os.setenv("TMPDIR", tmpdir, true); } catch (ErrnoException ex) { Log.w(TAG, "Unable to initialize $TMPDIR", ex); } } else { } else { Log.v(TAG, "Unable to initialize \"java.io.tmpdir\" property " Log.v(TAG, "Unable to initialize \"java.io.tmpdir\" property " + "due to missing cache directory"); + "due to missing cache directory"); Loading
core/tests/coretests/src/android/app/activity/ActivityThreadTest.java +5 −0 Original line number Original line Diff line number Diff line Loading @@ -87,6 +87,11 @@ public class ActivityThreadTest { new ActivityTestRule<>(TestActivity.class, true /* initialTouchMode */, new ActivityTestRule<>(TestActivity.class, true /* initialTouchMode */, false /* launchActivity */); false /* launchActivity */); @Test public void testTemporaryDirectory() throws Exception { assertEquals(System.getProperty("java.io.tmpdir"), System.getenv("TMPDIR")); } @Test @Test public void testDoubleRelaunch() throws Exception { public void testDoubleRelaunch() throws Exception { final Activity activity = mActivityTestRule.launchActivity(new Intent()); final Activity activity = mActivityTestRule.launchActivity(new Intent()); Loading