Eliminate dependencies on hardware/audio.h (trivial cases)
frameworks/av must not depend on hardware/ (except for the code
from libaudiohal that actually calls into HAL).
This CL deals with simple cases where depending on system/audio.h
is enough.
Change-Id: Ia2cb66cc8c92316ce5ab884a008d5e531263c2e4
Test: make
diff --git a/media/libaudiohal/DeviceHalLocal.h b/media/libaudiohal/DeviceHalLocal.h
index 6c15eb7..eba360c 100644
--- a/media/libaudiohal/DeviceHalLocal.h
+++ b/media/libaudiohal/DeviceHalLocal.h
@@ -17,6 +17,7 @@
#ifndef ANDROID_HARDWARE_DEVICE_HAL_LOCAL_H
#define ANDROID_HARDWARE_DEVICE_HAL_LOCAL_H
+#include <hardware/audio.h>
#include <media/audiohal/DeviceHalInterface.h>
namespace android {
diff --git a/media/libaudiohal/StreamHalLocal.cpp b/media/libaudiohal/StreamHalLocal.cpp
index 59314eb..12a1222 100644
--- a/media/libaudiohal/StreamHalLocal.cpp
+++ b/media/libaudiohal/StreamHalLocal.cpp
@@ -17,6 +17,7 @@
#define LOG_TAG "StreamHalLocal"
//#define LOG_NDEBUG 0
+#include <hardware/audio.h>
#include <utils/Log.h>
#include "DeviceHalLocal.h"
@@ -199,9 +200,9 @@
return OK;
}
-status_t StreamOutHalLocal::drain(audio_drain_type_t type) {
+status_t StreamOutHalLocal::drain(bool earlyNotify) {
if (mStream->drain == NULL) return INVALID_OPERATION;
- return mStream->drain(mStream, type);
+ return mStream->drain(mStream, earlyNotify ? AUDIO_DRAIN_EARLY_NOTIFY : AUDIO_DRAIN_ALL);
}
status_t StreamOutHalLocal::flush() {
diff --git a/media/libaudiohal/StreamHalLocal.h b/media/libaudiohal/StreamHalLocal.h
index 5e6f41a..1df18cc 100644
--- a/media/libaudiohal/StreamHalLocal.h
+++ b/media/libaudiohal/StreamHalLocal.h
@@ -107,7 +107,7 @@
virtual status_t supportsDrain(bool *supportsDrain);
// Requests notification when data buffered by the driver/hardware has been played.
- virtual status_t drain(audio_drain_type_t type);
+ virtual status_t drain(bool earlyNotify);
// Notifies to the audio driver to flush the queued data.
virtual status_t flush();