Audio HAL: Simplify types updates for 'common' and 'audio' packages
Instead of importing every single type individually ("using <type>"),
import entire namespaces of
::android::hardware::audio::CPP_VERSION and
::android::hardware::audio::common::CPP_VERSION
inside the "implementation" namespace in the default implementation.
This simplifies modifying types, as it is not needed anymore
to surround "using <type>" directives with #if MAJOR_VERSION ...
Note that the contents of the namespaces are imported inside
the "implementation" namespace, which reduces risks of name collision
Also, fixed the namespace for HidlUtils--it needs to be in
'implementation'.
Test: make
Change-Id: I81bbb3074b5763717ae72e747a075fd46dc36d18
diff --git a/audio/effect/all-versions/default/Conversions.cpp b/audio/effect/all-versions/default/Conversions.cpp
index 50b0562..b1c0b0d 100644
--- a/audio/effect/all-versions/default/Conversions.cpp
+++ b/audio/effect/all-versions/default/Conversions.cpp
@@ -17,14 +17,11 @@
#include "Conversions.h"
#include "HidlUtils.h"
-using ::android::hardware::audio::common::CPP_VERSION::HidlUtils;
-
#include <memory.h>
#include <stdio.h>
#include <common/all-versions/VersionUtils.h>
-using ::android::hardware::audio::common::CPP_VERSION::HidlUtils;
using ::android::hardware::audio::common::utils::EnumBitfield;
namespace android {
@@ -34,6 +31,8 @@
namespace CPP_VERSION {
namespace implementation {
+using ::android::hardware::audio::common::CPP_VERSION::implementation::HidlUtils;
+
void effectDescriptorFromHal(const effect_descriptor_t& halDescriptor,
EffectDescriptor* descriptor) {
HidlUtils::uuidFromHal(halDescriptor.type, &descriptor->type);
diff --git a/audio/effect/all-versions/default/EffectsFactory.cpp b/audio/effect/all-versions/default/EffectsFactory.cpp
index d2d8a46..6283e7b 100644
--- a/audio/effect/all-versions/default/EffectsFactory.cpp
+++ b/audio/effect/all-versions/default/EffectsFactory.cpp
@@ -32,8 +32,6 @@
#include "VisualizerEffect.h"
#include "common/all-versions/default/EffectMap.h"
-using ::android::hardware::audio::common::CPP_VERSION::HidlUtils;
-
#include <android/log.h>
#include <media/EffectsFactoryApi.h>
#include <system/audio_effects/effect_aec.h>
@@ -48,8 +46,6 @@
#include <system/audio_effects/effect_virtualizer.h>
#include <system/audio_effects/effect_visualizer.h>
-using ::android::hardware::audio::common::CPP_VERSION::HidlUtils;
-
namespace android {
namespace hardware {
namespace audio {
@@ -57,6 +53,8 @@
namespace CPP_VERSION {
namespace implementation {
+using ::android::hardware::audio::common::CPP_VERSION::implementation::HidlUtils;
+
// static
sp<IEffect> EffectsFactory::dispatchEffectInstanceCreation(const effect_descriptor_t& halDescriptor,
effect_handle_t handle) {