summaryrefslogtreecommitdiff
path: root/cmds/bootanimation/AudioPlayer.cpp
diff options
context:
space:
mode:
author Eric Laurent <elaurent@google.com> 2016-09-23 13:10:18 -0700
committer Eric Laurent <elaurent@google.com> 2016-09-23 21:23:27 +0000
commit75bf3fd73b5a75698f41f1593e384a9a3a3afb74 (patch)
treeca6a5cf77625e965df8473a3481cb20bb2c4f4c7 /cmds/bootanimation/AudioPlayer.cpp
parente36701214a70b4b6d91b51680af32e3155cb7c72 (diff)
DO NOT MERGE - fix truncated boot sound
Wait for audioserver service initialization to complete before playing the sound Bug: 31651778 Change-Id: I988de549d20468a090c939a1c624ee47d4036cd3
Diffstat (limited to 'cmds/bootanimation/AudioPlayer.cpp')
-rw-r--r--cmds/bootanimation/AudioPlayer.cpp4
1 files changed, 4 insertions, 0 deletions
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 <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 @@ 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;