Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3907f767 authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

Audio HAL: Simplify types updates for 'common' and 'effect' packages

Instead of importing every single type individually ("using <type>"),
import entire namespaces of
::android::hardware::audio::common::CPP_VERSION and
::android::hardware::audio::effect::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

Test: make
Change-Id: I5daa0ed91203726d1df67408ac9af728c247704a
parent b7ca29f3
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -40,10 +40,9 @@ namespace effect {
namespace CPP_VERSION {
namespace implementation {

using ::android::hardware::audio::common::CPP_VERSION::AudioChannelMask;
using ::android::hardware::audio::common::CPP_VERSION::AudioFormat;
using ::android::hardware::audio::common::CPP_VERSION::implementation::AudioChannelBitfield;
using ::android::hardware::audio::effect::CPP_VERSION::MessageQueueFlagBits;
using namespace ::android::hardware::audio::common::CPP_VERSION;
using namespace ::android::hardware::audio::effect::CPP_VERSION;

namespace {

+2 −13
Original line number Diff line number Diff line
@@ -47,20 +47,9 @@ using ::android::hardware::hidl_string;
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::audio::common::CPP_VERSION::AudioDevice;
using ::android::hardware::audio::common::CPP_VERSION::AudioMode;
using ::android::hardware::audio::common::CPP_VERSION::AudioSource;
using ::android::hardware::audio::common::CPP_VERSION::Uuid;
using ::android::hardware::audio::common::CPP_VERSION::implementation::AudioDeviceBitfield;
using ::android::hardware::audio::effect::CPP_VERSION::AudioBuffer;
using ::android::hardware::audio::effect::CPP_VERSION::EffectAuxChannelsConfig;
using ::android::hardware::audio::effect::CPP_VERSION::EffectConfig;
using ::android::hardware::audio::effect::CPP_VERSION::EffectDescriptor;
using ::android::hardware::audio::effect::CPP_VERSION::EffectFeature;
using ::android::hardware::audio::effect::CPP_VERSION::EffectOffloadParameter;
using ::android::hardware::audio::effect::CPP_VERSION::IEffect;
using ::android::hardware::audio::effect::CPP_VERSION::IEffectBufferProviderCallback;
using ::android::hardware::audio::effect::CPP_VERSION::Result;
using namespace ::android::hardware::audio::common::CPP_VERSION;
using namespace ::android::hardware::audio::effect::CPP_VERSION;

struct Effect : public IEffect {
    typedef MessageQueue<Result, kSynchronizedReadWrite> StatusMQ;
+2 −5
Original line number Diff line number Diff line
@@ -41,11 +41,8 @@ using ::android::hardware::hidl_string;
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::audio::common::CPP_VERSION::Uuid;
using ::android::hardware::audio::effect::CPP_VERSION::EffectDescriptor;
using ::android::hardware::audio::effect::CPP_VERSION::IEffect;
using ::android::hardware::audio::effect::CPP_VERSION::IEffectsFactory;
using ::android::hardware::audio::effect::CPP_VERSION::Result;
using namespace ::android::hardware::audio::common::CPP_VERSION;
using namespace ::android::hardware::audio::effect::CPP_VERSION;

struct EffectsFactory : public IEffectsFactory {
    // Methods from ::android::hardware::audio::effect::CPP_VERSION::IEffectsFactory follow.
+2 −12
Original line number Diff line number Diff line
@@ -43,18 +43,8 @@ using ::android::hardware::hidl_string;
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::audio::common::CPP_VERSION::AudioDevice;
using ::android::hardware::audio::common::CPP_VERSION::AudioMode;
using ::android::hardware::audio::common::CPP_VERSION::AudioSource;
using ::android::hardware::audio::effect::CPP_VERSION::AudioBuffer;
using ::android::hardware::audio::effect::CPP_VERSION::EffectAuxChannelsConfig;
using ::android::hardware::audio::effect::CPP_VERSION::EffectConfig;
using ::android::hardware::audio::effect::CPP_VERSION::EffectDescriptor;
using ::android::hardware::audio::effect::CPP_VERSION::EffectOffloadParameter;
using ::android::hardware::audio::effect::CPP_VERSION::IEffect;
using ::android::hardware::audio::effect::CPP_VERSION::IEffectBufferProviderCallback;
using ::android::hardware::audio::effect::CPP_VERSION::IEnvironmentalReverbEffect;
using ::android::hardware::audio::effect::CPP_VERSION::Result;
using namespace ::android::hardware::audio::common::CPP_VERSION;
using namespace ::android::hardware::audio::effect::CPP_VERSION;

struct EnvironmentalReverbEffect : public IEnvironmentalReverbEffect {
    explicit EnvironmentalReverbEffect(effect_handle_t handle);
+2 −12
Original line number Diff line number Diff line
@@ -39,18 +39,8 @@ using ::android::hardware::hidl_string;
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::audio::common::CPP_VERSION::AudioDevice;
using ::android::hardware::audio::common::CPP_VERSION::AudioMode;
using ::android::hardware::audio::common::CPP_VERSION::AudioSource;
using ::android::hardware::audio::effect::CPP_VERSION::AudioBuffer;
using ::android::hardware::audio::effect::CPP_VERSION::EffectAuxChannelsConfig;
using ::android::hardware::audio::effect::CPP_VERSION::EffectConfig;
using ::android::hardware::audio::effect::CPP_VERSION::EffectDescriptor;
using ::android::hardware::audio::effect::CPP_VERSION::EffectOffloadParameter;
using ::android::hardware::audio::effect::CPP_VERSION::IEffect;
using ::android::hardware::audio::effect::CPP_VERSION::IEffectBufferProviderCallback;
using ::android::hardware::audio::effect::CPP_VERSION::ILoudnessEnhancerEffect;
using ::android::hardware::audio::effect::CPP_VERSION::Result;
using namespace ::android::hardware::audio::common::CPP_VERSION;
using namespace ::android::hardware::audio::effect::CPP_VERSION;

struct LoudnessEnhancerEffect : public ILoudnessEnhancerEffect {
    explicit LoudnessEnhancerEffect(effect_handle_t handle);
Loading