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

Commit 9a772d6e authored by padarshr's avatar padarshr Committed by Gerrit - the friendly Code Review server
Browse files

Bootanimation crashes if Audio is not ready

This change makes sure bootanimation does
not crash even if Audio is not up.

Change-Id: I3ef510bf7fc26008eacbe02957a34cdccda2b548
parent 82bb9d95
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -882,6 +882,8 @@ void BootAnimation::playBackgroundMusic(void)
    FILE* fp = NULL;
    if ((fp = fopen("/proc/asound/cards", "r")) == NULL) {
        ALOGW("Cannot open /proc/asound/cards file to get sound card info.");
    } else {
        fclose(fp);
    }

    char value[PROPERTY_VALUE_MAX];
@@ -890,8 +892,6 @@ void BootAnimation::playBackgroundMusic(void)
        ALOGW("Audio service is not initiated.");
    }

    fclose(fp);

    char *fileName;
    if (((fileName = getBootRingtoneFileName(IMG_DATA)) != NULL && access(fileName, R_OK) == 0) ||
                ((fileName = getBootRingtoneFileName(IMG_SYS)) != NULL