Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1ed9f204 authored by Steve Kondik's avatar Steve Kondik
Browse files

am: Don't crash if cacheDir can't be created

 * Due to a bug in the multiuser code, it's possible for us to reach
   here by loading framework-res for a different user in which case the
   cache dir can't be created.
 * Add a null check to avoid the crash and subsequent lockup of AM.

Change-Id: I12f3a207d9fa0111286a67e29652f808ad5d9410
parent d227c957
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -4158,10 +4158,12 @@ public final class ActivityThread {
        appContext.init(data.info, null, this);
        final File cacheDir = appContext.getCacheDir();

        if (cacheDir != null) {
            // 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