Audio V4: Update namespace and version of 4.0 shim
Put the shim in a V4_0 namespace to comply with the ODR.
Make the include guard unique.
Split from the error prone interface adaptation change for safer review.
Patch generated with:
sed -i 's/V2_0/V4_0/g' *
sed -i "/include.*2.0/s/2\.0/4.0/" *
sed -i '/namespace android *{/anamespace V4_0 {' *
sed -Ei 's/(ifndef|define|endif)(.*)_H/\1\2_4_0_H/' *
sed -Ei 's#}(.*)namespace android$#}\1namespace V4_0\n\0#' *
Bug: 38184704
Test: Compile
Change-Id: I7d3aa46b3dfec664cbeea8a6b946456b8e8f06e3
Merged-In: I7d3aa46b3dfec664cbeea8a6b946456b8e8f06e3
Cherry-picked from master
Signed-off-by: Kevin Rocard <krocard@google.com>
diff --git a/media/libaudiohal/4.0/StreamHalHidl.h b/media/libaudiohal/4.0/StreamHalHidl.h
index d4ab943..8d4dc8c 100644
--- a/media/libaudiohal/4.0/StreamHalHidl.h
+++ b/media/libaudiohal/4.0/StreamHalHidl.h
@@ -14,14 +14,14 @@
* limitations under the License.
*/
-#ifndef ANDROID_HARDWARE_STREAM_HAL_HIDL_H
-#define ANDROID_HARDWARE_STREAM_HAL_HIDL_H
+#ifndef ANDROID_HARDWARE_STREAM_HAL_HIDL_4_0_H
+#define ANDROID_HARDWARE_STREAM_HAL_HIDL_4_0_H
#include <atomic>
-#include <android/hardware/audio/2.0/IStream.h>
-#include <android/hardware/audio/2.0/IStreamIn.h>
-#include <android/hardware/audio/2.0/IStreamOut.h>
+#include <android/hardware/audio/4.0/IStream.h>
+#include <android/hardware/audio/4.0/IStreamIn.h>
+#include <android/hardware/audio/4.0/IStreamOut.h>
#include <fmq/EventFlag.h>
#include <fmq/MessageQueue.h>
#include <media/audiohal/StreamHalInterface.h>
@@ -29,18 +29,19 @@
#include "ConversionHelperHidl.h"
#include "StreamPowerLog.h"
-using ::android::hardware::audio::V2_0::IStream;
-using ::android::hardware::audio::V2_0::IStreamIn;
-using ::android::hardware::audio::V2_0::IStreamOut;
+using ::android::hardware::audio::V4_0::IStream;
+using ::android::hardware::audio::V4_0::IStreamIn;
+using ::android::hardware::audio::V4_0::IStreamOut;
using ::android::hardware::EventFlag;
using ::android::hardware::MessageQueue;
using ::android::hardware::Return;
-using ReadParameters = ::android::hardware::audio::V2_0::IStreamIn::ReadParameters;
-using ReadStatus = ::android::hardware::audio::V2_0::IStreamIn::ReadStatus;
-using WriteCommand = ::android::hardware::audio::V2_0::IStreamOut::WriteCommand;
-using WriteStatus = ::android::hardware::audio::V2_0::IStreamOut::WriteStatus;
+using ReadParameters = ::android::hardware::audio::V4_0::IStreamIn::ReadParameters;
+using ReadStatus = ::android::hardware::audio::V4_0::IStreamIn::ReadStatus;
+using WriteCommand = ::android::hardware::audio::V4_0::IStreamOut::WriteCommand;
+using WriteStatus = ::android::hardware::audio::V4_0::IStreamOut::WriteStatus;
namespace android {
+namespace V4_0 {
class DeviceHalHidl;
@@ -234,6 +235,7 @@
status_t prepareForReading(size_t bufferSize);
};
+} // namespace V4_0
} // namespace android
-#endif // ANDROID_HARDWARE_STREAM_HAL_HIDL_H
+#endif // ANDROID_HARDWARE_STREAM_HAL_HIDL_4_0_H