DO NOT MERGE - fix truncated boot sound
am: 75bf3fd73b

Change-Id: I3394cdfc5878e1b3396a2858a40d4ddb0cda5b5c
diff --git a/cmds/bootanimation/Android.mk b/cmds/bootanimation/Android.mk
index 7c8842c..7f3fe22 100644
--- a/cmds/bootanimation/Android.mk
+++ b/cmds/bootanimation/Android.mk
@@ -23,7 +23,8 @@
     libEGL \
     libGLESv1_CM \
     libgui \
-    libtinyalsa
+    libtinyalsa \
+    libmedia
 
 LOCAL_MODULE:= bootanimation
 
diff --git a/cmds/bootanimation/AudioPlayer.cpp b/cmds/bootanimation/AudioPlayer.cpp
index 2932130..f5acac4 100644
--- a/cmds/bootanimation/AudioPlayer.cpp
+++ b/cmds/bootanimation/AudioPlayer.cpp
@@ -23,6 +23,7 @@
 #include <tinyalsa/asoundlib.h>
 #include <utils/Log.h>
 #include <utils/String8.h>
+#include <media/AudioSystem.h>
 
 #define ID_RIFF 0x46464952
 #define ID_WAVE 0x45564157
@@ -143,6 +144,9 @@
     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;