diff --git a/audio/aidl/Android.bp b/audio/aidl/Android.bp index d14151400c..789452dc96 100644 --- a/audio/aidl/Android.bp +++ b/audio/aidl/Android.bp @@ -230,6 +230,7 @@ aidl_interface { "android/hardware/audio/effect/BassBoost.aidl", "android/hardware/audio/effect/Capability.aidl", "android/hardware/audio/effect/CommandId.aidl", + "android/hardware/audio/effect/DefaultExtension.aidl", "android/hardware/audio/effect/Descriptor.aidl", "android/hardware/audio/effect/Downmix.aidl", "android/hardware/audio/effect/DynamicsProcessing.aidl", diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/DefaultExtension.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/DefaultExtension.aidl new file mode 100644 index 0000000000..f1cf3898c5 --- /dev/null +++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/DefaultExtension.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.audio.effect; +@VintfStability +parcelable DefaultExtension { + byte[] bytes; +} diff --git a/audio/aidl/android/hardware/audio/effect/DefaultExtension.aidl b/audio/aidl/android/hardware/audio/effect/DefaultExtension.aidl new file mode 100644 index 0000000000..33e827f838 --- /dev/null +++ b/audio/aidl/android/hardware/audio/effect/DefaultExtension.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.audio.effect; + +/** + * The default extension used for Parameter.Specific.vendorEffect ParcelableHolder. + * + * The audio framework attach this default extension to the ParcelableHolder in VendorExtension, + * and pass though all parameters it received from the client to audio HAL. + * + * For now it's not possible for vendor to define their own vendor extensions without changing the + * audio framework. More specificly, in order to add a customized effect parameter AIDL parcelable, + * vendors need to add the logic for conversion between AIDL and effect_param_t for the effect AIDL + * in: frameworks/av/media/libaudiohal/impl/effectAidlConversion. + * + * There is no VTS test cases for the vendor extension effect implementation, however all effect + * implementations must support the common parameters defined in Parameter.aidl, so vendor + * extension effect implementation still need to support setting and getting of these common + * parameters, which is enforced by VTS. + */ +@VintfStability +parcelable DefaultExtension { + byte[] bytes; +} diff --git a/audio/aidl/default/EffectImpl.cpp b/audio/aidl/default/EffectImpl.cpp index fa9eb958cb..e90fe35054 100644 --- a/audio/aidl/default/EffectImpl.cpp +++ b/audio/aidl/default/EffectImpl.cpp @@ -107,11 +107,8 @@ ndk::ScopedAStatus EffectImpl::getParameter(const Parameter::Id& id, Parameter* "CommonParamNotSupported"); break; } - case Parameter::Id::vendorEffectTag: { - LOG(DEBUG) << __func__ << " noop for vendor tag"; - return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT, - "vendortagNotSupported"); - } + case Parameter::Id::vendorEffectTag: + FALLTHROUGH_INTENDED; default: { Parameter::Specific specific; RETURN_IF_ASTATUS_NOT_OK(getParameterSpecific(id, &specific), "SpecParamNotSupported"); diff --git a/audio/aidl/default/audio_effects_config.xml b/audio/aidl/default/audio_effects_config.xml index 67855397a4..88c44599be 100644 --- a/audio/aidl/default/audio_effects_config.xml +++ b/audio/aidl/default/audio_effects_config.xml @@ -45,6 +45,7 @@ +