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

Commit dc9b0128 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Ensure /data/media before trying to upgrade.

Most devices create the path in their init.rc, but create it just
to be sure.  This fixes emulator boot failure.

Bug: 7058844
Change-Id: Icab3ce11c4304d972d13e1d9a0c269cfe05b9370
parent 080ca09c
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -384,6 +384,11 @@ int initialize_directories() {
        // Introducing multi-user, so migrate /data/media contents into /data/media/0
        ALOGD("Migrating /data/media for multi-user");

        // Ensure /data/media
        if (ensure_dir(android_media_dir.path, 0770, AID_MEDIA_RW, AID_MEDIA_RW) == -1) {
            goto fail;
        }

        // /data/media.tmp
        char media_tmp_dir[PATH_MAX];
        snprintf(media_tmp_dir, PATH_MAX, "%smedia.tmp", android_data_dir.path);