From 75bf3fd73b5a75698f41f1593e384a9a3a3afb74 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Fri, 23 Sep 2016 13:10:18 -0700 Subject: DO NOT MERGE - fix truncated boot sound Wait for audioserver service initialization to complete before playing the sound Bug: 31651778 Change-Id: I988de549d20468a090c939a1c624ee47d4036cd3 --- cmds/bootanimation/AudioPlayer.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cmds/bootanimation/AudioPlayer.cpp') diff --git a/cmds/bootanimation/AudioPlayer.cpp b/cmds/bootanimation/AudioPlayer.cpp index 293213008d58..f5acac485c81 100644 --- a/cmds/bootanimation/AudioPlayer.cpp +++ b/cmds/bootanimation/AudioPlayer.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #define ID_RIFF 0x46464952 #define ID_WAVE 0x45564157 @@ -143,6 +144,9 @@ bool AudioPlayer::init(const char* config) struct mixer* mixer = NULL; char name[MAX_LINE_LENGTH]; + // Fake call to wait for audio HAL initialization completion + AudioSystem::getParameters(String8("")); + for (;;) { const char* endl = strstr(config, "\n"); if (!endl) break; -- cgit v1.2.3-59-g8ed1b