Refactor audio code out of bootanimation_main.
So it can be shared with the iot/ variant I refactored it into the
audioplay.h file. This keeps all of the audio code local, we could hide
the functions and only expose the callback but that would make testing
harder.
Test: Ran a bootanimation.zip with audio.wav on Marlin, works as expected.
Bug: 67051984
Change-Id: Ie31dc5f2cfaad5bb23134ef81be712afa6b3cd6f
diff --git a/cmds/bootanimation/BootAnimationUtil.h b/cmds/bootanimation/BootAnimationUtil.h
index 60987cd1..1e1140a 100644
--- a/cmds/bootanimation/BootAnimationUtil.h
+++ b/cmds/bootanimation/BootAnimationUtil.h
@@ -14,6 +14,9 @@
* limitations under the License.
*/
+#ifndef ANDROID_BOOTANIMATION_UTIL_H
+#define ANDROID_BOOTANIMATION_UTIL_H
+
namespace android {
// Returns true if boot animation is disabled.
@@ -22,4 +25,8 @@
// Waits until the surface flinger is up.
void waitForSurfaceFlinger();
+// Returns whether sounds should be played during current boot.
+bool playSoundsAllowed();
} // namespace android
+
+#endif // ANDROID_BOOTANIMATION_UTIL_H