Merge "audio: clean up OWNERS"
diff --git a/audio/aidl/Android.bp b/audio/aidl/Android.bp
index 340cdb5..ef51361 100644
--- a/audio/aidl/Android.bp
+++ b/audio/aidl/Android.bp
@@ -114,7 +114,6 @@
"android/hardware/audio/core/AudioRoute.aidl",
"android/hardware/audio/core/IConfig.aidl",
"android/hardware/audio/core/IModule.aidl",
- "android/hardware/audio/core/ISoundDose.aidl",
"android/hardware/audio/core/IStreamCallback.aidl",
"android/hardware/audio/core/IStreamCommon.aidl",
"android/hardware/audio/core/IStreamIn.aidl",
@@ -133,6 +132,7 @@
"android.hardware.common-V2",
"android.hardware.common.fmq-V1",
"android.hardware.audio.common-V1",
+ "android.hardware.audio.core.sounddose-V1",
"android.hardware.audio.effect-V1",
"android.media.audio.common.types-V2",
],
@@ -178,7 +178,7 @@
"android.hardware.audio_defaults",
],
srcs: [
- "android/hardware/audio/core/ISoundDose.aidl",
+ "android/hardware/audio/core/sounddose/ISoundDose.aidl",
],
imports: [
"android.media.audio.common.types-V2",
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core.sounddose/current/android/hardware/audio/core/ISoundDose.aidl b/audio/aidl/aidl_api/android.hardware.audio.core.sounddose/current/android/hardware/audio/core/sounddose/ISoundDose.aidl
similarity index 88%
rename from audio/aidl/aidl_api/android.hardware.audio.core.sounddose/current/android/hardware/audio/core/ISoundDose.aidl
rename to audio/aidl/aidl_api/android.hardware.audio.core.sounddose/current/android/hardware/audio/core/sounddose/ISoundDose.aidl
index bc010ca..3b5d2d0 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.core.sounddose/current/android/hardware/audio/core/ISoundDose.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.core.sounddose/current/android/hardware/audio/core/sounddose/ISoundDose.aidl
@@ -31,18 +31,18 @@
// 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.core;
+package android.hardware.audio.core.sounddose;
@VintfStability
interface ISoundDose {
void setOutputRs2(float rs2ValueDbA);
float getOutputRs2();
- void registerSoundDoseCallback(in android.hardware.audio.core.ISoundDose.IHalSoundDoseCallback callback);
+ void registerSoundDoseCallback(in android.hardware.audio.core.sounddose.ISoundDose.IHalSoundDoseCallback callback);
const int DEFAULT_MAX_RS2 = 100;
const int MIN_RS2 = 80;
@VintfStability
interface IHalSoundDoseCallback {
oneway void onMomentaryExposureWarning(float currentDbA, in android.media.audio.common.AudioDevice audioDevice);
- oneway void onNewMelValues(in android.hardware.audio.core.ISoundDose.IHalSoundDoseCallback.MelRecord melRecord, in android.media.audio.common.AudioDevice audioDevice);
+ oneway void onNewMelValues(in android.hardware.audio.core.sounddose.ISoundDose.IHalSoundDoseCallback.MelRecord melRecord, in android.media.audio.common.AudioDevice audioDevice);
@VintfStability
parcelable MelRecord {
float[] melValues;
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IModule.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IModule.aidl
index 6a10295..a029d43 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IModule.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IModule.aidl
@@ -61,7 +61,7 @@
void updateAudioMode(android.hardware.audio.core.AudioMode mode);
void updateScreenRotation(android.hardware.audio.core.IModule.ScreenRotation rotation);
void updateScreenState(boolean isTurnedOn);
- @nullable android.hardware.audio.core.ISoundDose getSoundDose();
+ @nullable android.hardware.audio.core.sounddose.ISoundDose getSoundDose();
int generateHwAvSyncId();
android.hardware.audio.core.VendorParameter[] getVendorParameters(in @utf8InCpp String[] ids);
void setVendorParameters(in android.hardware.audio.core.VendorParameter[] parameters, boolean async);
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/ISoundDose.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/ISoundDose.aidl
deleted file mode 100644
index bc010ca..0000000
--- a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/ISoundDose.aidl
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2022 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 <name>-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.core;
-@VintfStability
-interface ISoundDose {
- void setOutputRs2(float rs2ValueDbA);
- float getOutputRs2();
- void registerSoundDoseCallback(in android.hardware.audio.core.ISoundDose.IHalSoundDoseCallback callback);
- const int DEFAULT_MAX_RS2 = 100;
- const int MIN_RS2 = 80;
- @VintfStability
- interface IHalSoundDoseCallback {
- oneway void onMomentaryExposureWarning(float currentDbA, in android.media.audio.common.AudioDevice audioDevice);
- oneway void onNewMelValues(in android.hardware.audio.core.ISoundDose.IHalSoundDoseCallback.MelRecord melRecord, in android.media.audio.common.AudioDevice audioDevice);
- @VintfStability
- parcelable MelRecord {
- float[] melValues;
- long timestamp;
- }
- }
-}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IStreamIn.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IStreamIn.aidl
index 68f1ff3..1041943 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IStreamIn.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IStreamIn.aidl
@@ -43,7 +43,7 @@
void updateMetadata(in android.hardware.audio.common.SinkMetadata sinkMetadata);
float[] getHwGain();
void setHwGain(in float[] channelGains);
- const int MIC_FIELD_DIMENSION_WIDE_ANGLE = -1;
+ const int MIC_FIELD_DIMENSION_WIDE_ANGLE = (-1);
const int MIC_FIELD_DIMENSION_NO_ZOOM = 0;
const int MIC_FIELD_DIMENSION_MAX_ZOOM = 1;
const int HW_GAIN_MIN = 0;
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/MicrophoneInfo.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/MicrophoneInfo.aidl
index 68c7f88..b77afe3 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/MicrophoneInfo.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/MicrophoneInfo.aidl
@@ -37,15 +37,15 @@
@utf8InCpp String id;
android.media.audio.common.AudioDevice device;
android.hardware.audio.core.MicrophoneInfo.Location location = android.hardware.audio.core.MicrophoneInfo.Location.UNKNOWN;
- int group = -1;
- int indexInTheGroup = -1;
+ int group = GROUP_UNKNOWN;
+ int indexInTheGroup = INDEX_IN_THE_GROUP_UNKNOWN;
@nullable android.hardware.audio.core.MicrophoneInfo.Sensitivity sensitivity;
android.hardware.audio.core.MicrophoneInfo.Directionality directionality = android.hardware.audio.core.MicrophoneInfo.Directionality.UNKNOWN;
android.hardware.audio.core.MicrophoneInfo.FrequencyResponsePoint[] frequencyResponse;
@nullable android.hardware.audio.core.MicrophoneInfo.Coordinate position;
@nullable android.hardware.audio.core.MicrophoneInfo.Coordinate orientation;
- const int GROUP_UNKNOWN = -1;
- const int INDEX_IN_THE_GROUP_UNKNOWN = -1;
+ const int GROUP_UNKNOWN = (-1);
+ const int INDEX_IN_THE_GROUP_UNKNOWN = (-1);
@Backing(type="int") @VintfStability
enum Location {
UNKNOWN = 0,
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/StreamDescriptor.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/StreamDescriptor.aidl
index 3a4271b..a65d7b7 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/StreamDescriptor.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/StreamDescriptor.aidl
@@ -39,12 +39,12 @@
int frameSizeBytes;
long bufferSizeFrames;
android.hardware.audio.core.StreamDescriptor.AudioBuffer audio;
- const int LATENCY_UNKNOWN = -1;
+ const int LATENCY_UNKNOWN = (-1);
@FixedSize @VintfStability
parcelable Position {
- long frames = -1;
- long timeNs = -1;
- const long UNKNOWN = -1;
+ long frames = UNKNOWN;
+ long timeNs = UNKNOWN;
+ const long UNKNOWN = (-1);
}
@Backing(type="int") @VintfStability
enum State {
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/BassBoost.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/BassBoost.aidl
index 09ad015..f8baa2a 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/BassBoost.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/BassBoost.aidl
@@ -36,8 +36,6 @@
union BassBoost {
android.hardware.audio.effect.VendorExtension vendor;
int strengthPm;
- const int MIN_PER_MILLE_STRENGTH = 0;
- const int MAX_PER_MILLE_STRENGTH = 1000;
@VintfStability
union Id {
int vendorExtensionTag;
@@ -46,6 +44,7 @@
@VintfStability
parcelable Capability {
ParcelableHolder extension;
+ int maxStrengthPm;
boolean strengthSupported;
}
}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Virtualizer.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Virtualizer.aidl
index deaff90..9fdd692 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Virtualizer.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Virtualizer.aidl
@@ -36,8 +36,6 @@
union Virtualizer {
android.hardware.audio.effect.VendorExtension vendor;
int strengthPm;
- const int MIN_PER_MILLE_STRENGTH = 0;
- const int MAX_PER_MILLE_STRENGTH = 1000;
@VintfStability
union Id {
int vendorExtensionTag;
@@ -46,6 +44,7 @@
@VintfStability
parcelable Capability {
android.hardware.audio.effect.VendorExtension extension;
+ int maxStrengthPm;
boolean strengthSupported;
}
}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Volume.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Volume.aidl
index ccd32e8..6259cfb 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Volume.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Volume.aidl
@@ -37,9 +37,6 @@
android.hardware.audio.effect.VendorExtension vendor;
int levelDb;
boolean mute;
- // TODO(b/263416041) Move to Capability
- const int MIN_LEVEL_DB = -9600;
- const int MAX_LEVEL_DB = 0;
@VintfStability
union Id {
int vendorExtensionTag;
@@ -48,6 +45,7 @@
@VintfStability
parcelable Capability {
android.hardware.audio.effect.VendorExtension extension;
- int maxLevel;
+ int minLevelDb;
+ int maxLevelDb;
}
}
diff --git a/audio/aidl/android/hardware/audio/core/IModule.aidl b/audio/aidl/android/hardware/audio/core/IModule.aidl
index f4ee1f3..4779f1f 100644
--- a/audio/aidl/android/hardware/audio/core/IModule.aidl
+++ b/audio/aidl/android/hardware/audio/core/IModule.aidl
@@ -21,7 +21,6 @@
import android.hardware.audio.core.AudioMode;
import android.hardware.audio.core.AudioPatch;
import android.hardware.audio.core.AudioRoute;
-import android.hardware.audio.core.ISoundDose;
import android.hardware.audio.core.IStreamCallback;
import android.hardware.audio.core.IStreamIn;
import android.hardware.audio.core.IStreamOut;
@@ -31,6 +30,7 @@
import android.hardware.audio.core.ModuleDebug;
import android.hardware.audio.core.StreamDescriptor;
import android.hardware.audio.core.VendorParameter;
+import android.hardware.audio.core.sounddose.ISoundDose;
import android.hardware.audio.effect.IEffect;
import android.media.audio.common.AudioOffloadInfo;
import android.media.audio.common.AudioPort;
diff --git a/audio/aidl/android/hardware/audio/core/ISoundDose.aidl b/audio/aidl/android/hardware/audio/core/sounddose/ISoundDose.aidl
similarity index 98%
rename from audio/aidl/android/hardware/audio/core/ISoundDose.aidl
rename to audio/aidl/android/hardware/audio/core/sounddose/ISoundDose.aidl
index 89fd69b..953ab62 100644
--- a/audio/aidl/android/hardware/audio/core/ISoundDose.aidl
+++ b/audio/aidl/android/hardware/audio/core/sounddose/ISoundDose.aidl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package android.hardware.audio.core;
+package android.hardware.audio.core.sounddose;
import android.media.audio.common.AudioDevice;
diff --git a/audio/aidl/android/hardware/audio/effect/BassBoost.aidl b/audio/aidl/android/hardware/audio/effect/BassBoost.aidl
index 9e5d8aa..6a94242 100644
--- a/audio/aidl/android/hardware/audio/effect/BassBoost.aidl
+++ b/audio/aidl/android/hardware/audio/effect/BassBoost.aidl
@@ -52,6 +52,10 @@
*/
ParcelableHolder extension;
/**
+ * Maximum possible per mille strength.
+ */
+ int maxStrengthPm;
+ /**
* Indicates whether setting strength is supported. False value indicates only one strength
* is supported and setParameter() method will return EX_ILLEGAL_ARGUMENT.
*/
@@ -59,23 +63,14 @@
}
/**
- * Minimal possible per mille strength.
- */
- const int MIN_PER_MILLE_STRENGTH = 0;
-
- /**
- * Maximum possible per mille strength.
- */
- const int MAX_PER_MILLE_STRENGTH = 1000;
-
- /**
* The per mille strength of the bass boost effect.
*
* If the implementation does not support per mille accuracy for setting the strength, it is
* allowed to round the given strength to the nearest supported value. In this case {@link
* #IEffect.getParameter()} method should return the rounded value that was actually set.
*
- * The valid range for strength is [0, 1000].
+ * The value of the strength must be non-negative and not exceed the value specified by
+ * the 'maxStrengthPm' capability.
*/
int strengthPm;
}
diff --git a/audio/aidl/android/hardware/audio/effect/Virtualizer.aidl b/audio/aidl/android/hardware/audio/effect/Virtualizer.aidl
index 90ec6f8..5f385a6 100644
--- a/audio/aidl/android/hardware/audio/effect/Virtualizer.aidl
+++ b/audio/aidl/android/hardware/audio/effect/Virtualizer.aidl
@@ -53,6 +53,10 @@
*/
VendorExtension extension;
/**
+ * Maximum possible per mille strength.
+ */
+ int maxStrengthPm;
+ /**
* Indicates whether setting strength is supported. False value indicates only one strength
* is supported and setParameter() method will always return EX_ILLEGAL_ARGUMENT.
*/
@@ -60,23 +64,14 @@
}
/**
- * Minimal possible per mille strength.
- */
- const int MIN_PER_MILLE_STRENGTH = 0;
-
- /**
- * Maximum possible per mille strength.
- */
- const int MAX_PER_MILLE_STRENGTH = 1000;
-
- /**
* The per mille strength of the virtualizer effect.
*
* If the implementation does not support per mille accuracy for setting the strength, it is
* allowed to round the given strength to the nearest supported value. In this case {@link
* #IEffect.getParameter()} method should return the rounded value that was actually set.
*
- * The valid range for strength is [0, 1000].
+ * The value of the strength must be non-negative and not exceed the value specified by
+ * the 'maxStrengthPm' capability.
*/
int strengthPm;
}
diff --git a/audio/aidl/android/hardware/audio/effect/Volume.aidl b/audio/aidl/android/hardware/audio/effect/Volume.aidl
index a9f8371..5033881 100644
--- a/audio/aidl/android/hardware/audio/effect/Volume.aidl
+++ b/audio/aidl/android/hardware/audio/effect/Volume.aidl
@@ -52,25 +52,18 @@
VendorExtension extension;
/**
- * Volume strength supported in dB.
+ * Minimum Volume level supported in dB.
*/
- int maxLevel;
+ int minLevelDb;
+
+ /**
+ * Maximum Volume level supported in dB.
+ */
+ int maxLevelDb;
}
- // TODO(b/263416041) Move to Capability
/**
- * Minimal level in dB.
- */
- const int MIN_LEVEL_DB = -9600;
-
- /**
- * Maximum level in dB.
- */
- const int MAX_LEVEL_DB = 0;
-
- /**
- /**
- * Current level in dB.
+ * Current level in dB with supported minimum and maximum level specified in capability.
*/
int levelDb;
/**
diff --git a/audio/aidl/default/Android.bp b/audio/aidl/default/Android.bp
index 7a1f7cd..8cd56c0 100644
--- a/audio/aidl/default/Android.bp
+++ b/audio/aidl/default/Android.bp
@@ -95,6 +95,7 @@
defaults: [
"aidlaudioservice_defaults",
"latest_android_media_audio_common_types_ndk_shared",
+ "latest_android_hardware_audio_core_sounddose_ndk_shared",
"latest_android_hardware_audio_core_ndk_shared",
],
static_libs: [
diff --git a/audio/aidl/default/Module.cpp b/audio/aidl/default/Module.cpp
index 6a833c4..b58c562 100644
--- a/audio/aidl/default/Module.cpp
+++ b/audio/aidl/default/Module.cpp
@@ -32,6 +32,7 @@
using aidl::android::hardware::audio::common::SinkMetadata;
using aidl::android::hardware::audio::common::SourceMetadata;
+using aidl::android::hardware::audio::core::sounddose::ISoundDose;
using aidl::android::media::audio::common::AudioChannelLayout;
using aidl::android::media::audio::common::AudioDevice;
using aidl::android::media::audio::common::AudioFormatDescription;
@@ -946,7 +947,7 @@
ndk::ScopedAStatus Module::getSoundDose(std::shared_ptr<ISoundDose>* _aidl_return) {
if (mSoundDose == nullptr) {
- mSoundDose = ndk::SharedRefBase::make<SoundDose>();
+ mSoundDose = ndk::SharedRefBase::make<sounddose::SoundDose>();
mSoundDoseBinder = mSoundDose->asBinder();
AIBinder_setMinSchedulerPolicy(mSoundDoseBinder.get(), SCHED_NORMAL,
ANDROID_PRIORITY_AUDIO);
diff --git a/audio/aidl/default/SoundDose.cpp b/audio/aidl/default/SoundDose.cpp
index 3d222a8..be9f93a 100644
--- a/audio/aidl/default/SoundDose.cpp
+++ b/audio/aidl/default/SoundDose.cpp
@@ -20,7 +20,7 @@
#include <android-base/logging.h>
-namespace aidl::android::hardware::audio::core {
+namespace aidl::android::hardware::audio::core::sounddose {
ndk::ScopedAStatus SoundDose::setOutputRs2(float in_rs2ValueDbA) {
if (in_rs2ValueDbA < MIN_RS2 || in_rs2ValueDbA > DEFAULT_MAX_RS2) {
@@ -54,4 +54,4 @@
return ndk::ScopedAStatus::ok();
}
-} // namespace aidl::android::hardware::audio::core
+} // namespace aidl::android::hardware::audio::core::sounddose
diff --git a/audio/aidl/default/bassboost/BassBoostSw.cpp b/audio/aidl/default/bassboost/BassBoostSw.cpp
index 8e4779d..0c7ebe1 100644
--- a/audio/aidl/default/bassboost/BassBoostSw.cpp
+++ b/audio/aidl/default/bassboost/BassBoostSw.cpp
@@ -62,7 +62,8 @@
const std::string BassBoostSw::kEffectName = "BassBoostSw";
const bool BassBoostSw::kStrengthSupported = true;
-const BassBoost::Capability BassBoostSw::kCapability = {.strengthSupported = kStrengthSupported};
+const BassBoost::Capability BassBoostSw::kCapability = {.maxStrengthPm = 1000,
+ .strengthSupported = kStrengthSupported};
const Descriptor BassBoostSw::kDescriptor = {
.common = {.id = {.type = kBassBoostTypeUUID,
.uuid = kBassBoostSwImplUUID,
@@ -171,4 +172,14 @@
return {STATUS_OK, samples, samples};
}
+RetCode BassBoostSwContext::setBbStrengthPm(int strength) {
+ if (strength < 0 || strength > BassBoostSw::kCapability.maxStrengthPm) {
+ LOG(ERROR) << __func__ << " invalid strength: " << strength;
+ return RetCode::ERROR_ILLEGAL_PARAMETER;
+ }
+ // TODO : Add implementation to apply new strength
+ mStrength = strength;
+ return RetCode::SUCCESS;
+}
+
} // namespace aidl::android::hardware::audio::effect
diff --git a/audio/aidl/default/bassboost/BassBoostSw.h b/audio/aidl/default/bassboost/BassBoostSw.h
index 91086e9..65c01c8 100644
--- a/audio/aidl/default/bassboost/BassBoostSw.h
+++ b/audio/aidl/default/bassboost/BassBoostSw.h
@@ -33,16 +33,7 @@
LOG(DEBUG) << __func__;
}
- RetCode setBbStrengthPm(int strength) {
- if (strength < BassBoost::MIN_PER_MILLE_STRENGTH ||
- strength > BassBoost::MAX_PER_MILLE_STRENGTH) {
- LOG(ERROR) << __func__ << " invalid strength: " << strength;
- return RetCode::ERROR_ILLEGAL_PARAMETER;
- }
- // TODO : Add implementation to apply new strength
- mStrength = strength;
- return RetCode::SUCCESS;
- }
+ RetCode setBbStrengthPm(int strength);
int getBbStrengthPm() const { return mStrength; }
private:
diff --git a/audio/aidl/default/include/core-impl/Module.h b/audio/aidl/default/include/core-impl/Module.h
index ff45f81..faca61e 100644
--- a/audio/aidl/default/include/core-impl/Module.h
+++ b/audio/aidl/default/include/core-impl/Module.h
@@ -88,7 +88,7 @@
ndk::ScopedAStatus updateScreenRotation(
::aidl::android::hardware::audio::core::IModule::ScreenRotation in_rotation) override;
ndk::ScopedAStatus updateScreenState(bool in_isTurnedOn) override;
- ndk::ScopedAStatus getSoundDose(std::shared_ptr<ISoundDose>* _aidl_return) override;
+ ndk::ScopedAStatus getSoundDose(std::shared_ptr<sounddose::ISoundDose>* _aidl_return) override;
ndk::ScopedAStatus generateHwAvSyncId(int32_t* _aidl_return) override;
ndk::ScopedAStatus getVendorParameters(const std::vector<std::string>& in_ids,
std::vector<VendorParameter>* _aidl_return) override;
@@ -140,7 +140,7 @@
bool mMasterMute = false;
float mMasterVolume = 1.0f;
bool mMicMute = false;
- std::shared_ptr<ISoundDose> mSoundDose;
+ std::shared_ptr<sounddose::ISoundDose> mSoundDose;
ndk::SpAIBinder mSoundDoseBinder;
};
diff --git a/audio/aidl/default/include/core-impl/SoundDose.h b/audio/aidl/default/include/core-impl/SoundDose.h
index 54a6cbf..306aa04 100644
--- a/audio/aidl/default/include/core-impl/SoundDose.h
+++ b/audio/aidl/default/include/core-impl/SoundDose.h
@@ -18,12 +18,12 @@
#include <mutex>
-#include <aidl/android/hardware/audio/core/BnSoundDose.h>
+#include <aidl/android/hardware/audio/core/sounddose/BnSoundDose.h>
#include <aidl/android/media/audio/common/AudioDevice.h>
using aidl::android::media::audio::common::AudioDevice;
-namespace aidl::android::hardware::audio::core {
+namespace aidl::android::hardware::audio::core::sounddose {
class SoundDose : public BnSoundDose {
public:
@@ -39,4 +39,4 @@
float mRs2Value;
};
-} // namespace aidl::android::hardware::audio::core
+} // namespace aidl::android::hardware::audio::core::sounddose
diff --git a/audio/aidl/default/virtualizer/VirtualizerSw.cpp b/audio/aidl/default/virtualizer/VirtualizerSw.cpp
index f4aa67c..cc51937 100644
--- a/audio/aidl/default/virtualizer/VirtualizerSw.cpp
+++ b/audio/aidl/default/virtualizer/VirtualizerSw.cpp
@@ -61,8 +61,8 @@
const std::string VirtualizerSw::kEffectName = "VirtualizerSw";
const bool VirtualizerSw::kStrengthSupported = true;
-const Virtualizer::Capability VirtualizerSw::kCapability = {.strengthSupported =
- kStrengthSupported};
+const Virtualizer::Capability VirtualizerSw::kCapability = {
+ .maxStrengthPm = 1000, .strengthSupported = kStrengthSupported};
const Descriptor VirtualizerSw::kDescriptor = {
.common = {.id = {.type = kVirtualizerTypeUUID,
.uuid = kVirtualizerSwImplUUID,
@@ -172,4 +172,14 @@
return {STATUS_OK, samples, samples};
}
+RetCode VirtualizerSwContext::setVrStrength(int strength) {
+ if (strength < 0 || strength > VirtualizerSw::kCapability.maxStrengthPm) {
+ LOG(ERROR) << __func__ << " invalid strength: " << strength;
+ return RetCode::ERROR_ILLEGAL_PARAMETER;
+ }
+ // TODO : Add implementation to apply new strength
+ mStrength = strength;
+ return RetCode::SUCCESS;
+}
+
} // namespace aidl::android::hardware::audio::effect
diff --git a/audio/aidl/default/virtualizer/VirtualizerSw.h b/audio/aidl/default/virtualizer/VirtualizerSw.h
index b4482da..0f294cd 100644
--- a/audio/aidl/default/virtualizer/VirtualizerSw.h
+++ b/audio/aidl/default/virtualizer/VirtualizerSw.h
@@ -32,16 +32,7 @@
: EffectContext(statusDepth, common) {
LOG(DEBUG) << __func__;
}
- RetCode setVrStrength(int strength) {
- if (strength < Virtualizer::MIN_PER_MILLE_STRENGTH ||
- strength > Virtualizer::MAX_PER_MILLE_STRENGTH) {
- LOG(ERROR) << __func__ << " invalid strength " << strength;
- return RetCode::ERROR_ILLEGAL_PARAMETER;
- }
- // TODO : Add implementation to apply new strength
- mStrength = strength;
- return RetCode::SUCCESS;
- }
+ RetCode setVrStrength(int strength);
int getVrStrength() const { return mStrength; }
private:
diff --git a/audio/aidl/default/visualizer/VisualizerSw.cpp b/audio/aidl/default/visualizer/VisualizerSw.cpp
index 735180e..614988c 100644
--- a/audio/aidl/default/visualizer/VisualizerSw.cpp
+++ b/audio/aidl/default/visualizer/VisualizerSw.cpp
@@ -241,4 +241,37 @@
return {STATUS_OK, samples, samples};
}
+RetCode VisualizerSwContext::setVsCaptureSize(int captureSize) {
+ if (captureSize < VisualizerSw::kCapability.captureSampleRange.min ||
+ captureSize > VisualizerSw::kCapability.captureSampleRange.max) {
+ LOG(ERROR) << __func__ << " invalid captureSize " << captureSize;
+ return RetCode::ERROR_ILLEGAL_PARAMETER;
+ }
+ // TODO : Add implementation to apply new captureSize
+ mCaptureSize = captureSize;
+ return RetCode::SUCCESS;
+}
+
+RetCode VisualizerSwContext::setVsScalingMode(Visualizer::ScalingMode scalingMode) {
+ // TODO : Add implementation to apply new scalingMode
+ mScalingMode = scalingMode;
+ return RetCode::SUCCESS;
+}
+
+RetCode VisualizerSwContext::setVsMeasurementMode(Visualizer::MeasurementMode measurementMode) {
+ // TODO : Add implementation to apply new measurementMode
+ mMeasurementMode = measurementMode;
+ return RetCode::SUCCESS;
+}
+
+RetCode VisualizerSwContext::setVsLatency(int latency) {
+ if (latency < 0 || latency > VisualizerSw::kCapability.maxLatencyMs) {
+ LOG(ERROR) << __func__ << " invalid latency " << latency;
+ return RetCode::ERROR_ILLEGAL_PARAMETER;
+ }
+ // TODO : Add implementation to modify latency
+ mLatency = latency;
+ return RetCode::SUCCESS;
+}
+
} // namespace aidl::android::hardware::audio::effect
diff --git a/audio/aidl/default/visualizer/VisualizerSw.h b/audio/aidl/default/visualizer/VisualizerSw.h
index 3c9e6d2..e9d46d7 100644
--- a/audio/aidl/default/visualizer/VisualizerSw.h
+++ b/audio/aidl/default/visualizer/VisualizerSw.h
@@ -38,40 +38,16 @@
fill(mCaptureSampleBuffer.begin(), mCaptureSampleBuffer.end(), 0x80);
}
- RetCode setVsCaptureSize(int captureSize) {
- if (captureSize < kMinCaptureSize || captureSize > kMaxCaptureSize) {
- LOG(ERROR) << __func__ << " invalid captureSize " << captureSize;
- return RetCode::ERROR_ILLEGAL_PARAMETER;
- }
- // TODO : Add implementation to apply new captureSize
- mCaptureSize = captureSize;
- return RetCode::SUCCESS;
- }
+ RetCode setVsCaptureSize(int captureSize);
int getVsCaptureSize() const { return mCaptureSize; }
- RetCode setVsScalingMode(Visualizer::ScalingMode scalingMode) {
- // TODO : Add implementation to apply new scalingMode
- mScalingMode = scalingMode;
- return RetCode::SUCCESS;
- }
+ RetCode setVsScalingMode(Visualizer::ScalingMode scalingMode);
Visualizer::ScalingMode getVsScalingMode() const { return mScalingMode; }
- RetCode setVsMeasurementMode(Visualizer::MeasurementMode measurementMode) {
- // TODO : Add implementation to apply new measurementMode
- mMeasurementMode = measurementMode;
- return RetCode::SUCCESS;
- }
+ RetCode setVsMeasurementMode(Visualizer::MeasurementMode measurementMode);
Visualizer::MeasurementMode getVsMeasurementMode() const { return mMeasurementMode; }
- RetCode setVsLatency(int latency) {
- if (latency < 0 || latency > kMaxLatencyMs) {
- LOG(ERROR) << __func__ << " invalid latency " << latency;
- return RetCode::ERROR_ILLEGAL_PARAMETER;
- }
- // TODO : Add implementation to modify latency
- mLatency = latency;
- return RetCode::SUCCESS;
- }
+ RetCode setVsLatency(int latency);
Visualizer::GetOnlyParameters::Measurement getVsMeasurement() const { return mMeasurement; }
std::vector<uint8_t> getVsCaptureSampleBuffer() const { return mCaptureSampleBuffer; }
diff --git a/audio/aidl/default/volume/VolumeSw.cpp b/audio/aidl/default/volume/VolumeSw.cpp
index 24e1e1d..64301dc 100644
--- a/audio/aidl/default/volume/VolumeSw.cpp
+++ b/audio/aidl/default/volume/VolumeSw.cpp
@@ -60,7 +60,7 @@
namespace aidl::android::hardware::audio::effect {
const std::string VolumeSw::kEffectName = "VolumeSw";
-const Volume::Capability VolumeSw::kCapability = {.maxLevel = Volume::MAX_LEVEL_DB};
+const Volume::Capability VolumeSw::kCapability = {.minLevelDb = -9600, .maxLevelDb = 0};
const Descriptor VolumeSw::kDescriptor = {
.common = {.id = {.type = kVolumeTypeUUID,
.uuid = kVolumeSwImplUUID,
@@ -176,4 +176,20 @@
return {STATUS_OK, samples, samples};
}
+RetCode VolumeSwContext::setVolLevel(int level) {
+ if (level < VolumeSw::kCapability.minLevelDb || level > VolumeSw::kCapability.maxLevelDb) {
+ LOG(ERROR) << __func__ << " invalid level " << level;
+ return RetCode::ERROR_ILLEGAL_PARAMETER;
+ }
+ // TODO : Add implementation to apply new level
+ mLevel = level;
+ return RetCode::SUCCESS;
+}
+
+RetCode VolumeSwContext::setVolMute(bool mute) {
+ // TODO : Add implementation to modify mute
+ mMute = mute;
+ return RetCode::SUCCESS;
+}
+
} // namespace aidl::android::hardware::audio::effect
diff --git a/audio/aidl/default/volume/VolumeSw.h b/audio/aidl/default/volume/VolumeSw.h
index a101c59..b6f6077 100644
--- a/audio/aidl/default/volume/VolumeSw.h
+++ b/audio/aidl/default/volume/VolumeSw.h
@@ -33,23 +33,11 @@
LOG(DEBUG) << __func__;
}
- RetCode setVolLevel(int level) {
- if (level < Volume::MIN_LEVEL_DB || level > Volume::MAX_LEVEL_DB) {
- LOG(ERROR) << __func__ << " invalid level " << level;
- return RetCode::ERROR_ILLEGAL_PARAMETER;
- }
- // TODO : Add implementation to apply new level
- mLevel = level;
- return RetCode::SUCCESS;
- }
+ RetCode setVolLevel(int level);
int getVolLevel() const { return mLevel; }
- RetCode setVolMute(bool mute) {
- // TODO : Add implementation to modify mute
- mMute = mute;
- return RetCode::SUCCESS;
- }
+ RetCode setVolMute(bool mute);
bool getVolMute() const { return mMute; }
diff --git a/audio/aidl/sounddose/aidl_api/android.hardware.audio.sounddose/current/android/hardware/audio/sounddose/ISoundDoseFactory.aidl b/audio/aidl/sounddose/aidl_api/android.hardware.audio.sounddose/current/android/hardware/audio/sounddose/ISoundDoseFactory.aidl
index 7dda011..148720c 100644
--- a/audio/aidl/sounddose/aidl_api/android.hardware.audio.sounddose/current/android/hardware/audio/sounddose/ISoundDoseFactory.aidl
+++ b/audio/aidl/sounddose/aidl_api/android.hardware.audio.sounddose/current/android/hardware/audio/sounddose/ISoundDoseFactory.aidl
@@ -34,5 +34,5 @@
package android.hardware.audio.sounddose;
@VintfStability
interface ISoundDoseFactory {
- @nullable android.hardware.audio.core.ISoundDose getSoundDose(in @utf8InCpp String module);
+ @nullable android.hardware.audio.core.sounddose.ISoundDose getSoundDose(in @utf8InCpp String module);
}
diff --git a/audio/aidl/sounddose/android/hardware/audio/sounddose/ISoundDoseFactory.aidl b/audio/aidl/sounddose/android/hardware/audio/sounddose/ISoundDoseFactory.aidl
index 3487237..4079fe8 100644
--- a/audio/aidl/sounddose/android/hardware/audio/sounddose/ISoundDoseFactory.aidl
+++ b/audio/aidl/sounddose/android/hardware/audio/sounddose/ISoundDoseFactory.aidl
@@ -16,7 +16,7 @@
package android.hardware.audio.sounddose;
-import android.hardware.audio.core.ISoundDose;
+import android.hardware.audio.core.sounddose.ISoundDose;
/**
* This interface is used to provide an easy way to implement the ISoundDose interface
diff --git a/audio/aidl/sounddose/default/SoundDoseFactory.cpp b/audio/aidl/sounddose/default/SoundDoseFactory.cpp
index 50796d0..83a592b 100644
--- a/audio/aidl/sounddose/default/SoundDoseFactory.cpp
+++ b/audio/aidl/sounddose/default/SoundDoseFactory.cpp
@@ -23,7 +23,7 @@
namespace aidl::android::hardware::audio::sounddose {
-using ::aidl::android::hardware::audio::core::SoundDose;
+using ::aidl::android::hardware::audio::core::sounddose::SoundDose;
ndk::ScopedAStatus SoundDoseFactory::getSoundDose(const std::string& in_module,
std::shared_ptr<ISoundDose>* _aidl_return) {
diff --git a/audio/aidl/sounddose/default/include/SoundDoseFactory.h b/audio/aidl/sounddose/default/include/SoundDoseFactory.h
index 4cf3277..ced4291 100644
--- a/audio/aidl/sounddose/default/include/SoundDoseFactory.h
+++ b/audio/aidl/sounddose/default/include/SoundDoseFactory.h
@@ -16,7 +16,7 @@
#pragma once
-#include <aidl/android/hardware/audio/core/ISoundDose.h>
+#include <aidl/android/hardware/audio/core/sounddose/ISoundDose.h>
#include <aidl/android/hardware/audio/sounddose/BnSoundDoseFactory.h>
#include <android/binder_interface_utils.h>
@@ -24,7 +24,7 @@
namespace aidl::android::hardware::audio::sounddose {
-using ::aidl::android::hardware::audio::core::ISoundDose;
+using ::aidl::android::hardware::audio::core::sounddose::ISoundDose;
class SoundDoseFactory : public BnSoundDoseFactory {
public:
diff --git a/audio/aidl/sounddose/vts/VtsHalSoundDoseFactoryTargetTest.cpp b/audio/aidl/sounddose/vts/VtsHalSoundDoseFactoryTargetTest.cpp
index 7448c1f..df35bae 100644
--- a/audio/aidl/sounddose/vts/VtsHalSoundDoseFactoryTargetTest.cpp
+++ b/audio/aidl/sounddose/vts/VtsHalSoundDoseFactoryTargetTest.cpp
@@ -47,7 +47,7 @@
using namespace android;
-using aidl::android::hardware::audio::core::ISoundDose;
+using aidl::android::hardware::audio::core::sounddose::ISoundDose;
using aidl::android::hardware::audio::sounddose::ISoundDoseFactory;
class SoundDoseFactory : public testing::TestWithParam<std::string> {
diff --git a/audio/aidl/vts/Android.bp b/audio/aidl/vts/Android.bp
index 5e6f53d..becdf1b 100644
--- a/audio/aidl/vts/Android.bp
+++ b/audio/aidl/vts/Android.bp
@@ -44,6 +44,7 @@
defaults: [
"VtsHalAudioTargetTestDefaults",
"latest_android_hardware_audio_core_ndk_static",
+ "latest_android_hardware_audio_core_sounddose_ndk_static",
],
shared_libs: [
"libcutils",
diff --git a/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp b/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp
index 1b46498..50a93ce 100644
--- a/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp
@@ -36,8 +36,8 @@
#include <aidl/Vintf.h>
#include <aidl/android/hardware/audio/core/BnStreamCallback.h>
#include <aidl/android/hardware/audio/core/IModule.h>
-#include <aidl/android/hardware/audio/core/ISoundDose.h>
#include <aidl/android/hardware/audio/core/ITelephony.h>
+#include <aidl/android/hardware/audio/core/sounddose/ISoundDose.h>
#include <aidl/android/media/audio/common/AudioIoFlags.h>
#include <aidl/android/media/audio/common/AudioOutputFlags.h>
#include <android-base/chrono_utils.h>
@@ -57,7 +57,6 @@
using aidl::android::hardware::audio::core::AudioPatch;
using aidl::android::hardware::audio::core::AudioRoute;
using aidl::android::hardware::audio::core::IModule;
-using aidl::android::hardware::audio::core::ISoundDose;
using aidl::android::hardware::audio::core::IStreamCommon;
using aidl::android::hardware::audio::core::IStreamIn;
using aidl::android::hardware::audio::core::IStreamOut;
@@ -67,6 +66,7 @@
using aidl::android::hardware::audio::core::ModuleDebug;
using aidl::android::hardware::audio::core::StreamDescriptor;
using aidl::android::hardware::audio::core::VendorParameter;
+using aidl::android::hardware::audio::core::sounddose::ISoundDose;
using aidl::android::hardware::common::fmq::SynchronizedReadWrite;
using aidl::android::media::audio::common::AudioContentType;
using aidl::android::media::audio::common::AudioDevice;
@@ -1755,13 +1755,12 @@
TEST_P(AudioCoreModule, AddRemoveEffectInvalidArguments) {
ndk::ScopedAStatus addEffectStatus = module->addDeviceEffect(-1, nullptr);
ndk::ScopedAStatus removeEffectStatus = module->removeDeviceEffect(-1, nullptr);
- const bool isSupported = addEffectStatus.getExceptionCode() != EX_UNSUPPORTED_OPERATION;
- if (isSupported) {
+ if (addEffectStatus.getExceptionCode() != EX_UNSUPPORTED_OPERATION) {
EXPECT_EQ(EX_ILLEGAL_ARGUMENT, addEffectStatus.getExceptionCode());
EXPECT_EQ(EX_ILLEGAL_ARGUMENT, removeEffectStatus.getExceptionCode());
- } else if (EX_UNSUPPORTED_OPERATION != removeEffectStatus.getExceptionCode()) {
- GTEST_FAIL() << "addEffect and removeEffect must be either supported or not supported "
- << "together";
+ } else if (removeEffectStatus.getExceptionCode() != EX_UNSUPPORTED_OPERATION) {
+ GTEST_FAIL() << "addDeviceEffect and removeDeviceEffect must be either supported or "
+ << "not supported together";
} else {
GTEST_SKIP() << "Offloaded effects not supported";
}
@@ -2128,15 +2127,13 @@
ASSERT_NE(nullptr, streamCommon);
ndk::ScopedAStatus addEffectStatus = streamCommon->addEffect(nullptr);
ndk::ScopedAStatus removeEffectStatus = streamCommon->removeEffect(nullptr);
- const bool isSupported = addEffectStatus.getExceptionCode() != EX_UNSUPPORTED_OPERATION;
- if (isSupported) {
+ if (addEffectStatus.getExceptionCode() != EX_UNSUPPORTED_OPERATION) {
EXPECT_EQ(EX_ILLEGAL_ARGUMENT, addEffectStatus.getExceptionCode());
EXPECT_EQ(EX_ILLEGAL_ARGUMENT, removeEffectStatus.getExceptionCode());
atLeastOneSupports = true;
- } else if (EX_UNSUPPORTED_OPERATION != removeEffectStatus.getExceptionCode()) {
- ADD_FAILURE()
- << "addEffect and removeEffect must be either supported or not supported "
- << "together";
+ } else if (removeEffectStatus.getExceptionCode() != EX_UNSUPPORTED_OPERATION) {
+ ADD_FAILURE() << "addEffect and removeEffect must be either supported or "
+ << "not supported together";
atLeastOneSupports = true;
}
}
@@ -2458,10 +2455,10 @@
ASSERT_TRUE(portConfig.has_value()) << "No profiles specified for output mix port";
WithStream<IStreamOut> stream(portConfig.value());
ASSERT_NO_FATAL_FAILURE(stream.SetUp(module.get(), kDefaultBufferSizeFrames));
- bool isSupported = false;
std::vector<AudioLatencyMode> supportedModes;
ndk::ScopedAStatus status = stream.get()->getRecommendedLatencyModes(&supportedModes);
if (status.getExceptionCode() == EX_UNSUPPORTED_OPERATION) continue;
+ atLeastOneSupports = true;
if (!status.isOk()) {
ADD_FAILURE() << "When latency modes are supported, getRecommendedLatencyModes "
<< "must succeed on a non-closed stream, but it failed with " << status;
@@ -2481,7 +2478,6 @@
for (const auto mode : unsupportedModes) {
EXPECT_STATUS(EX_ILLEGAL_ARGUMENT, stream.get()->setLatencyMode(mode));
}
- if (isSupported) atLeastOneSupports = true;
}
if (!atLeastOneSupports) {
GTEST_SKIP() << "Audio latency modes are not supported";
diff --git a/audio/aidl/vts/VtsHalBassBoostTargetTest.cpp b/audio/aidl/vts/VtsHalBassBoostTargetTest.cpp
index 724a9c3..d49a865 100644
--- a/audio/aidl/vts/VtsHalBassBoostTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalBassBoostTargetTest.cpp
@@ -46,15 +46,6 @@
* otherwise expect EX_ILLEGAL_ARGUMENT.
*/
-const std::vector<int> kStrengthValues = {
- std::numeric_limits<int>::min(),
- BassBoost::MIN_PER_MILLE_STRENGTH - 1,
- BassBoost::MIN_PER_MILLE_STRENGTH,
- (BassBoost::MIN_PER_MILLE_STRENGTH + BassBoost::MAX_PER_MILLE_STRENGTH) >> 1,
- BassBoost::MAX_PER_MILLE_STRENGTH,
- BassBoost::MAX_PER_MILLE_STRENGTH + 2,
- std::numeric_limits<int>::max()};
-
class BassBoostParamTest : public ::testing::TestWithParam<BassBoostParamTestParam>,
public EffectHelper {
public:
@@ -81,7 +72,7 @@
}
Parameter::Specific getDefaultParamSpecific() {
- BassBoost bb = BassBoost::make<BassBoost::strengthPm>(BassBoost::MIN_PER_MILLE_STRENGTH);
+ BassBoost bb = BassBoost::make<BassBoost::strengthPm>(0);
Parameter::Specific specific =
Parameter::Specific::make<Parameter::Specific::bassBoost>(bb);
return specific;
@@ -91,7 +82,7 @@
std::shared_ptr<IFactory> mFactory;
std::shared_ptr<IEffect> mEffect;
Descriptor mDescriptor;
- int mParamStrength = BassBoost::MIN_PER_MILLE_STRENGTH;
+ int mParamStrength = 0;
void SetAndGetBassBoostParameters() {
for (auto& it : mTags) {
@@ -146,8 +137,29 @@
}
bool isStrengthInRange(const BassBoost::Capability& cap, int strength) const {
- return cap.strengthSupported && strength >= BassBoost::MIN_PER_MILLE_STRENGTH &&
- strength <= BassBoost::MAX_PER_MILLE_STRENGTH;
+ return cap.strengthSupported && strength >= 0 && strength <= cap.maxStrengthPm;
+ }
+
+ static std::vector<int> getStrengthTestValues(
+ std::vector<std::pair<std::shared_ptr<IFactory>, Descriptor>> kFactoryDescList) {
+ const auto max = std::max_element(
+ kFactoryDescList.begin(), kFactoryDescList.end(),
+ [](const std::pair<std::shared_ptr<IFactory>, Descriptor>& a,
+ const std::pair<std::shared_ptr<IFactory>, Descriptor>& b) {
+ return a.second.capability.get<Capability::bassBoost>().maxStrengthPm <
+ b.second.capability.get<Capability::bassBoost>().maxStrengthPm;
+ });
+ if (max == kFactoryDescList.end()) {
+ return {0};
+ }
+ int maxStrength = max->second.capability.get<Capability::bassBoost>().maxStrengthPm;
+ return {std::numeric_limits<int>::min(),
+ -1,
+ 0,
+ maxStrength >> 1,
+ maxStrength,
+ maxStrength + 1,
+ std::numeric_limits<int>::max()};
}
private:
@@ -162,9 +174,12 @@
INSTANTIATE_TEST_SUITE_P(
BassBoostTest, BassBoostParamTest,
- ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
- IFactory::descriptor, kBassBoostTypeUUID)),
- testing::ValuesIn(kStrengthValues)),
+ ::testing::Combine(
+ testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(IFactory::descriptor,
+ kBassBoostTypeUUID)),
+ testing::ValuesIn(BassBoostParamTest::getStrengthTestValues(
+ EffectFactoryHelper::getAllEffectDescriptors(IFactory::descriptor,
+ kBassBoostTypeUUID)))),
[](const testing::TestParamInfo<BassBoostParamTest::ParamType>& info) {
auto descriptor = std::get<PARAM_INSTANCE_NAME>(info.param).second;
std::string strength = std::to_string(std::get<PARAM_STRENGTH>(info.param));
diff --git a/audio/aidl/vts/VtsHalVirtualizerTargetTest.cpp b/audio/aidl/vts/VtsHalVirtualizerTargetTest.cpp
index 61776b2..090de17 100644
--- a/audio/aidl/vts/VtsHalVirtualizerTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalVirtualizerTargetTest.cpp
@@ -44,11 +44,6 @@
* otherwise expect EX_ILLEGAL_ARGUMENT.
*/
-const std::vector<int> kStrengthValues = {
- std::numeric_limits<int>::min(), Virtualizer::MIN_PER_MILLE_STRENGTH - 1,
- Virtualizer::MIN_PER_MILLE_STRENGTH, Virtualizer::MAX_PER_MILLE_STRENGTH,
- Virtualizer::MAX_PER_MILLE_STRENGTH + 1, std::numeric_limits<int>::max()};
-
class VirtualizerParamTest : public ::testing::TestWithParam<VirtualizerParamTestParam>,
public EffectHelper {
public:
@@ -75,8 +70,7 @@
}
Parameter::Specific getDefaultParamSpecific() {
- Virtualizer vr =
- Virtualizer::make<Virtualizer::strengthPm>(Virtualizer::MIN_PER_MILLE_STRENGTH);
+ Virtualizer vr = Virtualizer::make<Virtualizer::strengthPm>(0);
Parameter::Specific specific =
Parameter::Specific::make<Parameter::Specific::virtualizer>(vr);
return specific;
@@ -86,7 +80,7 @@
std::shared_ptr<IFactory> mFactory;
std::shared_ptr<IEffect> mEffect;
Descriptor mDescriptor;
- int mParamStrength = Virtualizer::MIN_PER_MILLE_STRENGTH;
+ int mParamStrength = 0;
void SetAndGetVirtualizerParameters() {
for (auto& it : mTags) {
@@ -141,8 +135,29 @@
}
bool isStrengthInRange(const Virtualizer::Capability& cap, int strength) const {
- return cap.strengthSupported && strength >= Virtualizer::MIN_PER_MILLE_STRENGTH &&
- strength <= Virtualizer::MAX_PER_MILLE_STRENGTH;
+ return cap.strengthSupported && strength >= 0 && strength <= cap.maxStrengthPm;
+ }
+
+ static std::vector<int> getStrengthTestValues(
+ std::vector<std::pair<std::shared_ptr<IFactory>, Descriptor>> kFactoryDescList) {
+ const auto max = std::max_element(
+ kFactoryDescList.begin(), kFactoryDescList.end(),
+ [](const std::pair<std::shared_ptr<IFactory>, Descriptor>& a,
+ const std::pair<std::shared_ptr<IFactory>, Descriptor>& b) {
+ return a.second.capability.get<Capability::virtualizer>().maxStrengthPm <
+ b.second.capability.get<Capability::virtualizer>().maxStrengthPm;
+ });
+ if (max == kFactoryDescList.end()) {
+ return {0};
+ }
+ int maxStrength = max->second.capability.get<Capability::virtualizer>().maxStrengthPm;
+ return {std::numeric_limits<int>::min(),
+ -1,
+ 0,
+ maxStrength >> 1,
+ maxStrength,
+ maxStrength + 1,
+ std::numeric_limits<int>::max()};
}
private:
@@ -159,7 +174,9 @@
VirtualizerTest, VirtualizerParamTest,
::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
IFactory::descriptor, kVirtualizerTypeUUID)),
- testing::ValuesIn(kStrengthValues)),
+ testing::ValuesIn(VirtualizerParamTest::getStrengthTestValues(
+ EffectFactoryHelper::getAllEffectDescriptors(
+ IFactory::descriptor, kVirtualizerTypeUUID)))),
[](const testing::TestParamInfo<VirtualizerParamTest::ParamType>& info) {
auto descriptor = std::get<PARAM_INSTANCE_NAME>(info.param).second;
std::string strength = std::to_string(std::get<PARAM_STRENGTH>(info.param));
diff --git a/audio/aidl/vts/VtsHalVolumeTargetTest.cpp b/audio/aidl/vts/VtsHalVolumeTargetTest.cpp
index 3e82854..34625e7 100644
--- a/audio/aidl/vts/VtsHalVolumeTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalVolumeTargetTest.cpp
@@ -34,17 +34,14 @@
* Here we focus on specific parameter checking, general IEffect interfaces testing performed in
* VtsAudioEffectTargetTest.
*/
-enum ParamName { PARAM_INSTANCE_NAME, PARAM_LEVEL_DB, PARAM_MUTE };
+enum ParamName { PARAM_INSTANCE_NAME, PARAM_LEVEL, PARAM_MUTE };
using VolumeParamTestParam =
std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, int, bool>;
-const std::vector<int> kLevelValues = {Volume::MIN_LEVEL_DB - 1, Volume::MIN_LEVEL_DB, -100,
- Volume::MAX_LEVEL_DB, Volume::MAX_LEVEL_DB + 1};
-
class VolumeParamTest : public ::testing::TestWithParam<VolumeParamTestParam>, public EffectHelper {
public:
VolumeParamTest()
- : mParamLevel(std::get<PARAM_LEVEL_DB>(GetParam())),
+ : mParamLevel(std::get<PARAM_LEVEL>(GetParam())),
mParamMute(std::get<PARAM_MUTE>(GetParam())) {
std::tie(mFactory, mDescriptor) = std::get<PARAM_INSTANCE_NAME>(GetParam());
}
@@ -67,7 +64,7 @@
}
Parameter::Specific getDefaultParamSpecific() {
- Volume vol = Volume::make<Volume::levelDb>(Volume::MIN_LEVEL_DB);
+ Volume vol = Volume::make<Volume::levelDb>(-9600);
Parameter::Specific specific = Parameter::Specific::make<Parameter::Specific::volume>(vol);
return specific;
}
@@ -87,6 +84,8 @@
// validate parameter
Descriptor desc;
ASSERT_STATUS(EX_NONE, mEffect->getDescriptor(&desc));
+ // only set and get parameter if capability is valid
+ ASSERT_TRUE(isCapabilityValid(desc));
const bool valid = isTagInRange(it.first, it.second, desc);
const binder_exception_t expected = valid ? EX_NONE : EX_ILLEGAL_ARGUMENT;
@@ -97,7 +96,7 @@
expectParam.set<Parameter::specific>(specific);
EXPECT_STATUS(expected, mEffect->setParameter(expectParam)) << expectParam.toString();
- // only get if parameter in range and set success
+ // only get if parameter is in range and set success
if (expected == EX_NONE) {
Parameter getParam;
Parameter::Id id;
@@ -124,6 +123,11 @@
mTags.push_back({Volume::mute, vol});
}
+ bool isCapabilityValid(const Descriptor& desc) {
+ const Volume::Capability& volCap = desc.capability.get<Capability::volume>();
+ return (volCap.minLevelDb <= volCap.maxLevelDb);
+ }
+
bool isTagInRange(const Volume::Tag& tag, const Volume& vol, const Descriptor& desc) const {
const Volume::Capability& volCap = desc.capability.get<Capability::volume>();
switch (tag) {
@@ -138,9 +142,21 @@
}
}
- bool isLevelInRange(const Volume::Capability& cap, int level) const {
- return level >= Volume::MIN_LEVEL_DB && level <= Volume::MAX_LEVEL_DB &&
- level <= cap.maxLevel;
+ static std::vector<int> getLevelTestValues(
+ std::vector<std::pair<std::shared_ptr<IFactory>, Descriptor>> kFactoryDescList) {
+ int minLevelDb = std::numeric_limits<int>::max();
+ int maxLevelDb = std::numeric_limits<int>::min();
+ for (const auto& it : kFactoryDescList) {
+ maxLevelDb =
+ std::max(it.second.capability.get<Capability::volume>().maxLevelDb, maxLevelDb);
+ minLevelDb = std::min(it.second.capability.get<Capability ::volume>().minLevelDb,
+ minLevelDb);
+ }
+ return {minLevelDb - 1, minLevelDb, -100, maxLevelDb, maxLevelDb + 1};
+ }
+
+ bool isLevelInRange(const Volume::Capability& volCap, int level) const {
+ return level >= volCap.minLevelDb && level <= volCap.maxLevelDb;
}
private:
@@ -160,12 +176,16 @@
INSTANTIATE_TEST_SUITE_P(
VolumeTest, VolumeParamTest,
- ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
- IFactory::descriptor, kVolumeTypeUUID)),
- testing::ValuesIn(kLevelValues), testing::Bool()),
+ ::testing::Combine(
+ testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(IFactory::descriptor,
+ kVolumeTypeUUID)),
+ testing::ValuesIn(VolumeParamTest::getLevelTestValues(
+ EffectFactoryHelper::getAllEffectDescriptors(IFactory::descriptor,
+ kVolumeTypeUUID))),
+ testing::Bool() /* mute */),
[](const testing::TestParamInfo<VolumeParamTest::ParamType>& info) {
auto descriptor = std::get<PARAM_INSTANCE_NAME>(info.param).second;
- std::string level = std::to_string(std::get<PARAM_LEVEL_DB>(info.param));
+ std::string level = std::to_string(std::get<PARAM_LEVEL>(info.param));
std::string mute = std::to_string(std::get<PARAM_MUTE>(info.param));
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
diff --git a/audio/effect/all-versions/default/Effect.cpp b/audio/effect/all-versions/default/Effect.cpp
index b57dc63..5dc42dc 100644
--- a/audio/effect/all-versions/default/Effect.cpp
+++ b/audio/effect/all-versions/default/Effect.cpp
@@ -700,8 +700,21 @@
void* dataPtr = halDataSize > 0 ? &halData[0] : NULL;
void* resultPtr = halResultSize > 0 ? &halResult[0] : NULL;
- status_t status =
- (*mHandle)->command(mHandle, commandId, halDataSize, dataPtr, &halResultSize, resultPtr);
+ status_t status = BAD_VALUE;
+ switch (commandId) {
+ case 'gtid': // retrieve the tid, used for spatializer priority boost
+ if (halDataSize == 0 && resultMaxSize == sizeof(int32_t)) {
+ auto ptid = (int32_t*)resultPtr;
+ ptid[0] = mProcessThread ? mProcessThread->getTid() : -1;
+ status = OK;
+ break; // we have handled 'gtid' here.
+ }
+ [[fallthrough]]; // allow 'gtid' overload (checked halDataSize and resultMaxSize).
+ default:
+ status = (*mHandle)->command(mHandle, commandId, halDataSize, dataPtr, &halResultSize,
+ resultPtr);
+ break;
+ }
hidl_vec<uint8_t> result;
if (status == OK && resultPtr != NULL) {
result.setToExternal(&halResult[0], halResultSize);
diff --git a/camera/common/aidl/Android.bp b/camera/common/aidl/Android.bp
index d21ae58..fa74392 100644
--- a/camera/common/aidl/Android.bp
+++ b/camera/common/aidl/Android.bp
@@ -11,6 +11,7 @@
name: "android.hardware.camera.common",
vendor_available: true,
srcs: ["android/hardware/camera/common/*.aidl"],
+ frozen: true,
stability: "vintf",
backend: {
cpp: {
diff --git a/camera/device/aidl/Android.bp b/camera/device/aidl/Android.bp
index 6115d53..461e89d 100644
--- a/camera/device/aidl/Android.bp
+++ b/camera/device/aidl/Android.bp
@@ -11,13 +11,14 @@
name: "android.hardware.camera.device",
vendor_available: true,
srcs: ["android/hardware/camera/device/*.aidl"],
+ frozen: true,
stability: "vintf",
imports: [
"android.hardware.common-V2",
"android.hardware.common.fmq-V1",
- "android.hardware.camera.common",
- "android.hardware.camera.metadata",
- "android.hardware.graphics.common",
+ "android.hardware.camera.common-V1",
+ "android.hardware.camera.metadata-V1",
+ "android.hardware.graphics.common-V4",
],
backend: {
cpp: {
diff --git a/camera/metadata/aidl/Android.bp b/camera/metadata/aidl/Android.bp
index 301a943..8c13ce5 100644
--- a/camera/metadata/aidl/Android.bp
+++ b/camera/metadata/aidl/Android.bp
@@ -11,6 +11,7 @@
name: "android.hardware.camera.metadata",
vendor_available: true,
srcs: ["android/hardware/camera/metadata/*.aidl"],
+ frozen: true,
stability: "vintf",
backend: {
cpp: {
diff --git a/camera/provider/aidl/Android.bp b/camera/provider/aidl/Android.bp
index 87a94b2..e2c2bea 100644
--- a/camera/provider/aidl/Android.bp
+++ b/camera/provider/aidl/Android.bp
@@ -14,8 +14,8 @@
"android/hardware/camera/provider/*.aidl",
],
imports: [
- "android.hardware.camera.device",
- "android.hardware.camera.common",
+ "android.hardware.camera.device-V1",
+ "android.hardware.camera.common-V1",
],
stability: "vintf",
backend: {
diff --git a/compatibility_matrices/exclude/fcm_exclude.cpp b/compatibility_matrices/exclude/fcm_exclude.cpp
index cf1e138..3c0c5f1 100644
--- a/compatibility_matrices/exclude/fcm_exclude.cpp
+++ b/compatibility_matrices/exclude/fcm_exclude.cpp
@@ -52,6 +52,7 @@
"android.hardware.radio.config@1.2",
// AIDL
"android.hardware.audio.common",
+ "android.hardware.audio.core.sounddose",
"android.hardware.biometrics.common",
"android.hardware.camera.metadata",
"android.hardware.camera.device",