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

Commit de32220f authored by Chad Brubaker's avatar Chad Brubaker Committed by android-build-merger
Browse files

Merge "Create Instant App cookie dir if it doesn't exist" into oc-dev am: d2cc513e

am: 75a64a45

Change-Id: Ie4d9d3f3f84920a75afd4cd1bd07737f3ad95aa8
parents 0c672cd4 75a64a45
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -218,6 +218,11 @@ class InstantAppRegistry {
        byte[] randomBytes = new byte[8];
        new SecureRandom().nextBytes(randomBytes);
        String id = ByteStringUtils.toHexString(randomBytes).toLowerCase(Locale.US);
        File appDir = getInstantApplicationDir(packageName, userId);
        if (!appDir.exists() && !appDir.mkdirs()) {
            Slog.e(LOG_TAG, "Cannot create instant app cookie directory");
            return id;
        }
        File idFile = new File(getInstantApplicationDir(packageName, userId),
                INSTANT_APP_ANDROID_ID_FILE);
        try (FileOutputStream fos = new FileOutputStream(idFile)) {