Merge "Added ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE to HAL." into udc-dev
diff --git a/audio/aidl/Android.bp b/audio/aidl/Android.bp
index e6b0cee..bb48ecd 100644
--- a/audio/aidl/Android.bp
+++ b/audio/aidl/Android.bp
@@ -36,12 +36,13 @@
"android.hardware.audio_defaults",
],
srcs: [
+ "android/hardware/audio/common/AudioOffloadMetadata.aidl",
"android/hardware/audio/common/PlaybackTrackMetadata.aidl",
"android/hardware/audio/common/RecordTrackMetadata.aidl",
"android/hardware/audio/common/SinkMetadata.aidl",
"android/hardware/audio/common/SourceMetadata.aidl",
],
- frozen: true,
+ frozen: false,
imports: [
"android.media.audio.common.types-V2",
],
@@ -77,7 +78,7 @@
}
// Note: This should always be one version ahead of the last frozen version
-latest_android_hardware_audio_common = "android.hardware.audio.common-V1"
+latest_android_hardware_audio_common = "android.hardware.audio.common-V2"
// Modules that depend on android.hardware.audio.common directly can include
// the following cc_defaults to avoid explicitly managing dependency versions
@@ -112,6 +113,7 @@
"android/hardware/audio/core/AudioPatch.aidl",
"android/hardware/audio/core/AudioRoute.aidl",
"android/hardware/audio/core/IBluetooth.aidl",
+ "android/hardware/audio/core/IBluetoothA2dp.aidl",
"android/hardware/audio/core/IConfig.aidl",
"android/hardware/audio/core/IModule.aidl",
"android/hardware/audio/core/IStreamCallback.aidl",
@@ -129,7 +131,7 @@
imports: [
"android.hardware.common-V2",
"android.hardware.common.fmq-V1",
- "android.hardware.audio.common-V1",
+ "android.hardware.audio.common-V2",
"android.hardware.audio.core.sounddose-V1",
"android.hardware.audio.effect-V1",
"android.media.audio.common.types-V2",
@@ -253,7 +255,7 @@
imports: [
"android.hardware.common-V2",
"android.hardware.common.fmq-V1",
- "android.hardware.audio.common-V1",
+ "android.hardware.audio.common-V2",
"android.media.audio.common.types-V2",
],
backend: {
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiRadioCombinationMatrix.aidl b/audio/aidl/aidl_api/android.hardware.audio.common/current/android/hardware/audio/common/AudioOffloadMetadata.aidl
similarity index 82%
copy from wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiRadioCombinationMatrix.aidl
copy to audio/aidl/aidl_api/android.hardware.audio.common/current/android/hardware/audio/common/AudioOffloadMetadata.aidl
index ea86c4f..000504b 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiRadioCombinationMatrix.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.common/current/android/hardware/audio/common/AudioOffloadMetadata.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2022 The Android Open Source Project
+ * 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.
@@ -31,8 +31,12 @@
// 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.wifi;
-@VintfStability
-parcelable WifiRadioCombinationMatrix {
- android.hardware.wifi.WifiRadioCombination[] radioCombinations;
+package android.hardware.audio.common;
+@JavaDerive(equals=true, toString=true) @VintfStability
+parcelable AudioOffloadMetadata {
+ int sampleRate;
+ android.media.audio.common.AudioChannelLayout channelMask;
+ int averageBitRatePerSecond;
+ int delayFrames;
+ int paddingFrames;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiRadioCombinationMatrix.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IBluetoothA2dp.aidl
similarity index 83%
copy from wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiRadioCombinationMatrix.aidl
copy to audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IBluetoothA2dp.aidl
index ea86c4f..0f4c46d 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiRadioCombinationMatrix.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IBluetoothA2dp.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2022 The Android Open Source Project
+ * 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.
@@ -31,8 +31,11 @@
// 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.wifi;
+package android.hardware.audio.core;
@VintfStability
-parcelable WifiRadioCombinationMatrix {
- android.hardware.wifi.WifiRadioCombination[] radioCombinations;
+interface IBluetoothA2dp {
+ boolean isEnabled();
+ void setEnabled(boolean enabled);
+ boolean supportsOffloadReconfiguration();
+ void reconfigureOffload(in android.hardware.audio.core.VendorParameter[] parameters);
}
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 1eafdab..f18d6a5 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
@@ -37,6 +37,7 @@
void setModuleDebug(in android.hardware.audio.core.ModuleDebug debug);
@nullable android.hardware.audio.core.ITelephony getTelephony();
@nullable android.hardware.audio.core.IBluetooth getBluetooth();
+ @nullable android.hardware.audio.core.IBluetoothA2dp getBluetoothA2dp();
android.media.audio.common.AudioPort connectExternalDevice(in android.media.audio.common.AudioPort templateIdAndAdditionalData);
void disconnectExternalDevice(int portId);
android.hardware.audio.core.AudioPatch[] getAudioPatches();
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IStreamCommon.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IStreamCommon.aidl
index f0bf100..65a2ee4 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IStreamCommon.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IStreamCommon.aidl
@@ -35,6 +35,7 @@
@VintfStability
interface IStreamCommon {
void close();
+ void prepareToClose();
void updateHwAvSyncId(int hwAvSyncId);
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/IStreamOut.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IStreamOut.aidl
index 46acc11..ec3078e 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IStreamOut.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IStreamOut.aidl
@@ -36,6 +36,7 @@
interface IStreamOut {
android.hardware.audio.core.IStreamCommon getStreamCommon();
void updateMetadata(in android.hardware.audio.common.SourceMetadata sourceMetadata);
+ void updateOffloadMetadata(in android.hardware.audio.common.AudioOffloadMetadata offloadMetadata);
float[] getHwVolume();
void setHwVolume(in float[] channelVolumes);
float getAudioDescriptionMixLevel();
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/AcousticEchoCanceler.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/AcousticEchoCanceler.aidl
index 1ec7dad..16367c0 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/AcousticEchoCanceler.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/AcousticEchoCanceler.aidl
@@ -39,7 +39,7 @@
boolean mobileMode;
@VintfStability
union Id {
- int vendorExtensionTag;
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
android.hardware.audio.effect.AcousticEchoCanceler.Tag commonTag;
}
}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/AutomaticGainControlV1.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/AutomaticGainControlV1.aidl
index 57d4418..e69e2bd 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/AutomaticGainControlV1.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/AutomaticGainControlV1.aidl
@@ -40,7 +40,7 @@
boolean enableLimiter;
@VintfStability
union Id {
- int vendorExtensionTag;
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
android.hardware.audio.effect.AutomaticGainControlV1.Tag commonTag;
}
}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/AutomaticGainControlV2.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/AutomaticGainControlV2.aidl
index bdb481c..46ffcaf 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/AutomaticGainControlV2.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/AutomaticGainControlV2.aidl
@@ -40,7 +40,7 @@
int saturationMarginMb;
@VintfStability
union Id {
- int vendorExtensionTag;
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
android.hardware.audio.effect.AutomaticGainControlV2.Tag commonTag;
}
@Backing(type="int") @VintfStability
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 d09fe54..c248ce8 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
@@ -38,7 +38,7 @@
int strengthPm;
@VintfStability
union Id {
- int vendorExtensionTag;
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
android.hardware.audio.effect.BassBoost.Tag commonTag;
}
}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Downmix.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Downmix.aidl
index 45a1f28..ce0a7df 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Downmix.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Downmix.aidl
@@ -38,7 +38,7 @@
android.hardware.audio.effect.Downmix.Type type;
@VintfStability
union Id {
- int vendorExtensionTag;
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
android.hardware.audio.effect.Downmix.Tag commonTag;
}
@VintfStability
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/DynamicsProcessing.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/DynamicsProcessing.aidl
index 3e20e33..04f627d 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/DynamicsProcessing.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/DynamicsProcessing.aidl
@@ -34,7 +34,7 @@
package android.hardware.audio.effect;
@VintfStability
union DynamicsProcessing {
- android.hardware.audio.effect.VendorExtension vendorExtension;
+ android.hardware.audio.effect.VendorExtension vendor;
android.hardware.audio.effect.DynamicsProcessing.EngineArchitecture engineArchitecture;
android.hardware.audio.effect.DynamicsProcessing.ChannelConfig[] preEq;
android.hardware.audio.effect.DynamicsProcessing.ChannelConfig[] postEq;
@@ -46,7 +46,7 @@
android.hardware.audio.effect.DynamicsProcessing.InputGain[] inputGain;
@VintfStability
union Id {
- int vendorExtensionTag;
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
android.hardware.audio.effect.DynamicsProcessing.Tag commonTag;
}
enum ResolutionPreference {
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/EnvironmentalReverb.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/EnvironmentalReverb.aidl
index c12ebb8..00b7d1a 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/EnvironmentalReverb.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/EnvironmentalReverb.aidl
@@ -48,7 +48,7 @@
boolean bypass;
@VintfStability
union Id {
- int vendorExtensionTag;
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
android.hardware.audio.effect.EnvironmentalReverb.Tag commonTag;
}
}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Equalizer.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Equalizer.aidl
index 3e3539f..80f7c7e 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Equalizer.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Equalizer.aidl
@@ -34,7 +34,7 @@
package android.hardware.audio.effect;
@VintfStability
union Equalizer {
- android.hardware.audio.effect.VendorExtension vendorExtension;
+ android.hardware.audio.effect.VendorExtension vendor;
android.hardware.audio.effect.Equalizer.BandLevel[] bandLevels;
int preset;
int[] centerFreqMh;
@@ -42,7 +42,7 @@
android.hardware.audio.effect.Equalizer.Preset[] presets;
@VintfStability
union Id {
- int vendorExtensionTag;
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
android.hardware.audio.effect.Equalizer.Tag commonTag;
}
@VintfStability
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/HapticGenerator.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/HapticGenerator.aidl
index a7dc265..8addab7 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/HapticGenerator.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/HapticGenerator.aidl
@@ -34,12 +34,12 @@
package android.hardware.audio.effect;
@VintfStability
union HapticGenerator {
- android.hardware.audio.effect.VendorExtension vendorExtension;
+ android.hardware.audio.effect.VendorExtension vendor;
android.hardware.audio.effect.HapticGenerator.HapticScale[] hapticScales;
android.hardware.audio.effect.HapticGenerator.VibratorInformation vibratorInfo;
@VintfStability
union Id {
- int vendorExtensionTag;
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
android.hardware.audio.effect.HapticGenerator.Tag commonTag;
}
@Backing(type="int") @VintfStability
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/LoudnessEnhancer.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/LoudnessEnhancer.aidl
index 774f45f..fc276d6 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/LoudnessEnhancer.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/LoudnessEnhancer.aidl
@@ -38,7 +38,7 @@
int gainMb;
@VintfStability
union Id {
- int vendorExtensionTag;
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
android.hardware.audio.effect.LoudnessEnhancer.Tag commonTag;
}
}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/NoiseSuppression.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/NoiseSuppression.aidl
index f1a3449..7f30fe2 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/NoiseSuppression.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/NoiseSuppression.aidl
@@ -39,7 +39,7 @@
android.hardware.audio.effect.NoiseSuppression.Type type;
@VintfStability
union Id {
- int vendorExtensionTag;
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
android.hardware.audio.effect.NoiseSuppression.Tag commonTag;
}
@Backing(type="int") @VintfStability
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Parameter.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Parameter.aidl
index 14aa1e8..b50a2f1 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Parameter.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Parameter.aidl
@@ -42,7 +42,7 @@
android.hardware.audio.effect.Parameter.Specific specific;
@VintfStability
union Id {
- int vendorEffectTag;
+ android.hardware.audio.effect.VendorExtension vendorEffectTag;
android.hardware.audio.effect.AcousticEchoCanceler.Id acousticEchoCancelerTag;
android.hardware.audio.effect.AutomaticGainControlV1.Id automaticGainControlV1Tag;
android.hardware.audio.effect.AutomaticGainControlV2.Id automaticGainControlV2Tag;
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/PresetReverb.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/PresetReverb.aidl
index 148f79d..26d96b5 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/PresetReverb.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/PresetReverb.aidl
@@ -49,7 +49,7 @@
}
@VintfStability
union Id {
- int vendorExtensionTag;
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
android.hardware.audio.effect.PresetReverb.Tag commonTag;
}
}
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 e9611e4..6092b14 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
@@ -40,7 +40,7 @@
android.media.audio.common.AudioDeviceDescription device;
@VintfStability
union Id {
- int vendorExtensionTag;
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
android.hardware.audio.effect.Virtualizer.Tag commonTag;
android.hardware.audio.effect.Virtualizer.SpeakerAnglesPayload speakerAnglesPayload;
}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Visualizer.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Visualizer.aidl
index d1b1b3e..7d319da 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Visualizer.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Visualizer.aidl
@@ -44,7 +44,7 @@
android.hardware.audio.effect.Visualizer.MeasurementMode measurementMode;
@VintfStability
union Id {
- int vendorExtensionTag;
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
android.hardware.audio.effect.Visualizer.Tag commonTag;
}
@VintfStability
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 c2b2df7..8227118 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
@@ -39,7 +39,7 @@
boolean mute;
@VintfStability
union Id {
- int vendorExtensionTag;
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
android.hardware.audio.effect.Volume.Tag commonTag;
}
}
diff --git a/audio/aidl/android/hardware/audio/common/AudioOffloadMetadata.aidl b/audio/aidl/android/hardware/audio/common/AudioOffloadMetadata.aidl
new file mode 100644
index 0000000..5881658
--- /dev/null
+++ b/audio/aidl/android/hardware/audio/common/AudioOffloadMetadata.aidl
@@ -0,0 +1,44 @@
+/*
+ * 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.common;
+
+import android.media.audio.common.AudioChannelLayout;
+
+/**
+ * Dynamic metadata for offloaded compressed audio.
+ * For static metadata, see android.media.audio.common.AudioOffloadInfo.
+ */
+@JavaDerive(equals=true, toString=true)
+@VintfStability
+parcelable AudioOffloadMetadata {
+ int sampleRate;
+ AudioChannelLayout channelMask;
+ /** Average bit rate in bits per second. */
+ int averageBitRatePerSecond;
+ /**
+ * Number of frames to be ignored at the beginning of the stream.
+ * The value must be non-negative. A value of 0 indicates no delay
+ * has to be applied.
+ */
+ int delayFrames;
+ /**
+ * Number of frames to be ignored at the end of the stream.
+ * The value must be non-negative. A value of 0 indicates no padding
+ * has to be applied.
+ */
+ int paddingFrames;
+}
diff --git a/audio/aidl/android/hardware/audio/core/IBluetoothA2dp.aidl b/audio/aidl/android/hardware/audio/core/IBluetoothA2dp.aidl
new file mode 100644
index 0000000..dc4b8d0
--- /dev/null
+++ b/audio/aidl/android/hardware/audio/core/IBluetoothA2dp.aidl
@@ -0,0 +1,83 @@
+/*
+ * 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.core;
+
+import android.hardware.audio.core.VendorParameter;
+
+/**
+ * An instance of IBluetoothA2dp manages settings for the A2DP (Advanced Audio
+ * Distribution Profile) profiles. This interface is optional to implement by
+ * the vendor. It needs to be provided only if the device actually supports BT
+ * A2DP.
+ *
+ * This interface is separate from IBluetooth interface which manages SCO & HFP.
+ * The HAL module can handle both SCO and A2DP profiles or only one of them.
+ */
+@VintfStability
+interface IBluetoothA2dp {
+ /**
+ * Whether BT A2DP is enabled.
+ *
+ * Returns the current state of A2DP support. The client might need to
+ * disable (suspend) A2DP when another profile (for example, SCO) is
+ * activated.
+ *
+ * @return Whether BT A2DP is enabled.
+ */
+ boolean isEnabled();
+
+ /**
+ * Enable or disable A2DP.
+ *
+ * Sets the current state of A2DP support. The client might need to
+ * disable (suspend) A2DP when another profile (for example, SCO) is
+ * activated.
+ *
+ * @param enabled Whether BT A2DP must be enabled or suspended.
+ * @throws EX_ILLEGAL_STATE If there was an error performing the operation.
+ */
+ void setEnabled(boolean enabled);
+
+ /**
+ * Indicates whether the module supports reconfiguration of offloaded codecs.
+ *
+ * Offloaded coded implementations may need to be reconfigured when the
+ * active A2DP device changes. This method indicates whether the HAL module
+ * supports the reconfiguration event. The result returned from this method
+ * must not change over time.
+ *
+ * @return Whether reconfiguration offload of offloaded codecs is supported.
+ */
+ boolean supportsOffloadReconfiguration();
+
+ /**
+ * Instructs the HAL module to reconfigure offloaded codec.
+ *
+ * Offloaded coded implementations may need to be reconfigured when the
+ * active A2DP device changes. This method is a notification for the HAL
+ * module to commence reconfiguration.
+ *
+ * Note that 'EX_UNSUPPORTED_OPERATION' may only be thrown when
+ * 'supportsOffloadReconfiguration' returns 'false'.
+ *
+ * @param parameter Optional vendor-specific parameters, can be left empty.
+ * @throws EX_ILLEGAL_STATE If there was an error performing the operation,
+ * or the operation can not be commenced in the current state.
+ * @throws EX_UNSUPPORTED_OPERATION If the module does not support codec reconfiguration.
+ */
+ void reconfigureOffload(in VendorParameter[] parameters);
+}
diff --git a/audio/aidl/android/hardware/audio/core/IModule.aidl b/audio/aidl/android/hardware/audio/core/IModule.aidl
index edfb9f2..080d826 100644
--- a/audio/aidl/android/hardware/audio/core/IModule.aidl
+++ b/audio/aidl/android/hardware/audio/core/IModule.aidl
@@ -21,6 +21,7 @@
import android.hardware.audio.core.AudioPatch;
import android.hardware.audio.core.AudioRoute;
import android.hardware.audio.core.IBluetooth;
+import android.hardware.audio.core.IBluetoothA2dp;
import android.hardware.audio.core.IStreamCallback;
import android.hardware.audio.core.IStreamIn;
import android.hardware.audio.core.IStreamOut;
@@ -103,6 +104,20 @@
@nullable IBluetooth getBluetooth();
/**
+ * Retrieve the interface to control Bluetooth A2DP.
+ *
+ * If the HAL module supports A2DP Profile functionality for Bluetooth, it
+ * must return an instance of the IBluetoothA2dp interface. The same
+ * instance must be returned during the lifetime of the HAL module. If the
+ * HAL module does not support BT A2DP, a null must be returned, without
+ * throwing any errors.
+ *
+ * @return An instance of the IBluetoothA2dp interface implementation.
+ * @throws EX_ILLEGAL_STATE If there was an error creating an instance.
+ */
+ @nullable IBluetoothA2dp getBluetoothA2dp();
+
+ /**
* Set a device port of an external device into connected state.
*
* This method is used to inform the HAL module that an external device has
@@ -596,6 +611,7 @@
* @param mute Whether the output from the module is muted.
* @throws EX_UNSUPPORTED_OPERATION If muting of combined output
* is not supported by the module.
+ * @throws EX_ILLEGAL_STATE If any error happens while muting of combined output.
*/
void setMasterMute(boolean mute);
@@ -627,6 +643,8 @@
* accepted range.
* @throws EX_UNSUPPORTED_OPERATION If attenuation of combined output
* is not supported by the module.
+ * @throws EX_ILLEGAL_STATE If any error happens while updating attenuation of
+ combined output.
*/
void setMasterVolume(float volume);
diff --git a/audio/aidl/android/hardware/audio/core/IStreamCommon.aidl b/audio/aidl/android/hardware/audio/core/IStreamCommon.aidl
index 533ef67..543d9e2 100644
--- a/audio/aidl/android/hardware/audio/core/IStreamCommon.aidl
+++ b/audio/aidl/android/hardware/audio/core/IStreamCommon.aidl
@@ -44,6 +44,33 @@
void close();
/**
+ * Notify the stream that it is about to be closed.
+ *
+ * This is a notification sent by the client to indicate that it intends to
+ * close the stream "soon" (the actual time period is unspecified). The
+ * purpose of this notification is to allow the stream implementation to
+ * unblock the I/O thread. This is useful for HAL modules that act as
+ * proxies to other subsystems, examples are "bluetooth" and "r_submix"
+ * modules. In such modules the I/O thread might get blocked on a read or
+ * write operation to the external subsystem. Thus, calling 'close' directly
+ * will stall, as it will try to send the 'Command.halReservedExit' on the
+ * I/O thread which is blocked and is not reading commands from the FMQ. The
+ * HAL implementation must initiate unblocking as a result of receiving the
+ * 'prepareToClose' notification.
+ *
+ * This operation must be handled by the HAL module in an "asynchronous"
+ * manner, returning control back as quick as possible.
+ *
+ * Since this operation does not have any effects observable from the client
+ * side, the HAL module must be able to handle multiple calls of this method
+ * without throwing any errors. The only case when this method is allowed
+ * to throw is when the stream has been closed.
+ *
+ * @throws EX_ILLEGAL_STATE If the stream is closed.
+ */
+ void prepareToClose();
+
+ /**
* Update the HW AV Sync identifier for the stream.
*
* The argument to this method must be one of the identifiers previously
diff --git a/audio/aidl/android/hardware/audio/core/IStreamOut.aidl b/audio/aidl/android/hardware/audio/core/IStreamOut.aidl
index 0e58add..f26dc1c 100644
--- a/audio/aidl/android/hardware/audio/core/IStreamOut.aidl
+++ b/audio/aidl/android/hardware/audio/core/IStreamOut.aidl
@@ -16,6 +16,7 @@
package android.hardware.audio.core;
+import android.hardware.audio.common.AudioOffloadMetadata;
import android.hardware.audio.common.SourceMetadata;
import android.hardware.audio.core.IStreamCommon;
import android.media.audio.common.AudioDualMonoMode;
@@ -48,6 +49,18 @@
*/
void updateMetadata(in SourceMetadata sourceMetadata);
+ /**
+ * Update offload metadata for a compressed stream.
+ *
+ * Updates the offload metadata initially provided at the stream creation.
+ *
+ * @param offloadMetadata Updated offload metadata.
+ * @throws EX_ILLEGAL_STATE If the stream is closed.
+ * @throws EX_ILLEGAL_ARGUMENT If the metadata contains invalid values.
+ * @throws EX_UNSUPPORTED_OPERATION If the stream is not for compressed offload.
+ */
+ void updateOffloadMetadata(in AudioOffloadMetadata offloadMetadata);
+
const int HW_VOLUME_MIN = 0;
const int HW_VOLUME_MAX = 1;
/**
@@ -85,7 +98,8 @@
* @throws EX_ILLEGAL_ARGUMENT If the number of elements in the provided
* array does not match the channel count, or
* attenuation values are out of range.
- * @throws EX_ILLEGAL_STATE If the stream is closed.
+ * @throws EX_ILLEGAL_STATE If the stream is closed or there is any error happens
+ when applying hardware volume.
* @throws EX_UNSUPPORTED_OPERATION If hardware volume control is not supported.
*/
void setHwVolume(in float[] channelVolumes);
diff --git a/audio/aidl/android/hardware/audio/effect/AcousticEchoCanceler.aidl b/audio/aidl/android/hardware/audio/effect/AcousticEchoCanceler.aidl
index 49377d6..bf1f8a2 100644
--- a/audio/aidl/android/hardware/audio/effect/AcousticEchoCanceler.aidl
+++ b/audio/aidl/android/hardware/audio/effect/AcousticEchoCanceler.aidl
@@ -33,7 +33,7 @@
*/
@VintfStability
union Id {
- int vendorExtensionTag;
+ VendorExtension vendorExtensionTag;
AcousticEchoCanceler.Tag commonTag;
}
diff --git a/audio/aidl/android/hardware/audio/effect/AutomaticGainControlV1.aidl b/audio/aidl/android/hardware/audio/effect/AutomaticGainControlV1.aidl
index 9b2feff..e7bf99d 100644
--- a/audio/aidl/android/hardware/audio/effect/AutomaticGainControlV1.aidl
+++ b/audio/aidl/android/hardware/audio/effect/AutomaticGainControlV1.aidl
@@ -35,7 +35,7 @@
*/
@VintfStability
union Id {
- int vendorExtensionTag;
+ VendorExtension vendorExtensionTag;
AutomaticGainControlV1.Tag commonTag;
}
diff --git a/audio/aidl/android/hardware/audio/effect/AutomaticGainControlV2.aidl b/audio/aidl/android/hardware/audio/effect/AutomaticGainControlV2.aidl
index 836d6b8..8f2afdc 100644
--- a/audio/aidl/android/hardware/audio/effect/AutomaticGainControlV2.aidl
+++ b/audio/aidl/android/hardware/audio/effect/AutomaticGainControlV2.aidl
@@ -36,7 +36,7 @@
*/
@VintfStability
union Id {
- int vendorExtensionTag;
+ VendorExtension vendorExtensionTag;
AutomaticGainControlV2.Tag commonTag;
}
diff --git a/audio/aidl/android/hardware/audio/effect/BassBoost.aidl b/audio/aidl/android/hardware/audio/effect/BassBoost.aidl
index d734825..479db96 100644
--- a/audio/aidl/android/hardware/audio/effect/BassBoost.aidl
+++ b/audio/aidl/android/hardware/audio/effect/BassBoost.aidl
@@ -32,7 +32,7 @@
*/
@VintfStability
union Id {
- int vendorExtensionTag;
+ VendorExtension vendorExtensionTag;
BassBoost.Tag commonTag;
}
diff --git a/audio/aidl/android/hardware/audio/effect/Downmix.aidl b/audio/aidl/android/hardware/audio/effect/Downmix.aidl
index f90e339..90fd4c7 100644
--- a/audio/aidl/android/hardware/audio/effect/Downmix.aidl
+++ b/audio/aidl/android/hardware/audio/effect/Downmix.aidl
@@ -31,7 +31,7 @@
*/
@VintfStability
union Id {
- int vendorExtensionTag;
+ VendorExtension vendorExtensionTag;
Downmix.Tag commonTag;
}
diff --git a/audio/aidl/android/hardware/audio/effect/DynamicsProcessing.aidl b/audio/aidl/android/hardware/audio/effect/DynamicsProcessing.aidl
index 486d4f4..5aea211 100644
--- a/audio/aidl/android/hardware/audio/effect/DynamicsProcessing.aidl
+++ b/audio/aidl/android/hardware/audio/effect/DynamicsProcessing.aidl
@@ -32,14 +32,14 @@
*/
@VintfStability
union Id {
- int vendorExtensionTag;
+ VendorExtension vendorExtensionTag;
DynamicsProcessing.Tag commonTag;
}
/**
* Vendor DynamicsProcessing implementation definition for additional parameters.
*/
- VendorExtension vendorExtension;
+ VendorExtension vendor;
/**
* Resolution preference definition.
diff --git a/audio/aidl/android/hardware/audio/effect/EnvironmentalReverb.aidl b/audio/aidl/android/hardware/audio/effect/EnvironmentalReverb.aidl
index 95d1ff6..1d58e50 100644
--- a/audio/aidl/android/hardware/audio/effect/EnvironmentalReverb.aidl
+++ b/audio/aidl/android/hardware/audio/effect/EnvironmentalReverb.aidl
@@ -33,7 +33,7 @@
*/
@VintfStability
union Id {
- int vendorExtensionTag;
+ VendorExtension vendorExtensionTag;
EnvironmentalReverb.Tag commonTag;
}
diff --git a/audio/aidl/android/hardware/audio/effect/Equalizer.aidl b/audio/aidl/android/hardware/audio/effect/Equalizer.aidl
index 2bce151..e727f70 100644
--- a/audio/aidl/android/hardware/audio/effect/Equalizer.aidl
+++ b/audio/aidl/android/hardware/audio/effect/Equalizer.aidl
@@ -31,14 +31,14 @@
*/
@VintfStability
union Id {
- int vendorExtensionTag;
+ VendorExtension vendorExtensionTag;
Equalizer.Tag commonTag;
}
/**
* Vendor Equalizer implementation definition for additional parameters.
*/
- VendorExtension vendorExtension;
+ VendorExtension vendor;
/**
* Level setting for each band in millibels.
diff --git a/audio/aidl/android/hardware/audio/effect/HapticGenerator.aidl b/audio/aidl/android/hardware/audio/effect/HapticGenerator.aidl
index a8e4564..3cc5acb 100644
--- a/audio/aidl/android/hardware/audio/effect/HapticGenerator.aidl
+++ b/audio/aidl/android/hardware/audio/effect/HapticGenerator.aidl
@@ -33,14 +33,14 @@
*/
@VintfStability
union Id {
- int vendorExtensionTag;
+ VendorExtension vendorExtensionTag;
HapticGenerator.Tag commonTag;
}
/**
* Vendor HapticGenerator implementation definition for additional parameters.
*/
- VendorExtension vendorExtension;
+ VendorExtension vendor;
@VintfStability
@Backing(type="int")
diff --git a/audio/aidl/android/hardware/audio/effect/LoudnessEnhancer.aidl b/audio/aidl/android/hardware/audio/effect/LoudnessEnhancer.aidl
index a7cbe8d..23e1e5a 100644
--- a/audio/aidl/android/hardware/audio/effect/LoudnessEnhancer.aidl
+++ b/audio/aidl/android/hardware/audio/effect/LoudnessEnhancer.aidl
@@ -32,7 +32,7 @@
*/
@VintfStability
union Id {
- int vendorExtensionTag;
+ VendorExtension vendorExtensionTag;
LoudnessEnhancer.Tag commonTag;
}
diff --git a/audio/aidl/android/hardware/audio/effect/NoiseSuppression.aidl b/audio/aidl/android/hardware/audio/effect/NoiseSuppression.aidl
index 6c2fb5f..c6bcc43 100644
--- a/audio/aidl/android/hardware/audio/effect/NoiseSuppression.aidl
+++ b/audio/aidl/android/hardware/audio/effect/NoiseSuppression.aidl
@@ -35,7 +35,7 @@
*/
@VintfStability
union Id {
- int vendorExtensionTag;
+ VendorExtension vendorExtensionTag;
NoiseSuppression.Tag commonTag;
}
diff --git a/audio/aidl/android/hardware/audio/effect/Parameter.aidl b/audio/aidl/android/hardware/audio/effect/Parameter.aidl
index 9f8874b..229c621 100644
--- a/audio/aidl/android/hardware/audio/effect/Parameter.aidl
+++ b/audio/aidl/android/hardware/audio/effect/Parameter.aidl
@@ -66,10 +66,10 @@
@VintfStability
union Id {
/**
- * Parameter tag defined for vendor effects. Use int here so there is flexibility for vendor
- * to define different tag.
+ * Parameter tag defined for vendor effects. Use VendorExtension here so it's possible to
+ * pass customized information.
*/
- int vendorEffectTag;
+ VendorExtension vendorEffectTag;
/**
* Parameter tag defined for nested parameters. Can be used to get any parameter defined in
* nested Union structure.
diff --git a/audio/aidl/android/hardware/audio/effect/PresetReverb.aidl b/audio/aidl/android/hardware/audio/effect/PresetReverb.aidl
index 87c78b0..a36da2c 100644
--- a/audio/aidl/android/hardware/audio/effect/PresetReverb.aidl
+++ b/audio/aidl/android/hardware/audio/effect/PresetReverb.aidl
@@ -68,7 +68,7 @@
*/
@VintfStability
union Id {
- int vendorExtensionTag;
+ VendorExtension vendorExtensionTag;
PresetReverb.Tag commonTag;
}
diff --git a/audio/aidl/android/hardware/audio/effect/Virtualizer.aidl b/audio/aidl/android/hardware/audio/effect/Virtualizer.aidl
index 37ea2a4..1dbb509 100644
--- a/audio/aidl/android/hardware/audio/effect/Virtualizer.aidl
+++ b/audio/aidl/android/hardware/audio/effect/Virtualizer.aidl
@@ -34,7 +34,7 @@
*/
@VintfStability
union Id {
- int vendorExtensionTag;
+ VendorExtension vendorExtensionTag;
Virtualizer.Tag commonTag;
SpeakerAnglesPayload speakerAnglesPayload;
}
diff --git a/audio/aidl/android/hardware/audio/effect/Visualizer.aidl b/audio/aidl/android/hardware/audio/effect/Visualizer.aidl
index 8f2faaa..0b37546 100644
--- a/audio/aidl/android/hardware/audio/effect/Visualizer.aidl
+++ b/audio/aidl/android/hardware/audio/effect/Visualizer.aidl
@@ -33,7 +33,7 @@
*/
@VintfStability
union Id {
- int vendorExtensionTag;
+ VendorExtension vendorExtensionTag;
Visualizer.Tag commonTag;
}
Id id;
diff --git a/audio/aidl/android/hardware/audio/effect/Volume.aidl b/audio/aidl/android/hardware/audio/effect/Volume.aidl
index 4a76703..15cfdd2 100644
--- a/audio/aidl/android/hardware/audio/effect/Volume.aidl
+++ b/audio/aidl/android/hardware/audio/effect/Volume.aidl
@@ -31,7 +31,7 @@
*/
@VintfStability
union Id {
- int vendorExtensionTag;
+ VendorExtension vendorExtensionTag;
Volume.Tag commonTag;
}
diff --git a/audio/aidl/default/Android.bp b/audio/aidl/default/Android.bp
index 21616be..ea00dcb 100644
--- a/audio/aidl/default/Android.bp
+++ b/audio/aidl/default/Android.bp
@@ -54,12 +54,13 @@
],
}
-cc_library_static {
+cc_library {
name: "libaudioserviceexampleimpl",
defaults: [
"aidlaudioservice_defaults",
"latest_android_media_audio_common_types_ndk_shared",
"latest_android_hardware_audio_core_ndk_shared",
+ "latest_android_hardware_audio_core_sounddose_ndk_shared",
],
export_include_dirs: ["include"],
srcs: [
@@ -75,6 +76,7 @@
"Telephony.cpp",
"usb/ModuleUsb.cpp",
"usb/StreamUsb.cpp",
+ "usb/UsbAlsaMixerControl.cpp",
"usb/UsbAlsaUtils.cpp",
],
generated_sources: [
diff --git a/audio/aidl/default/Bluetooth.cpp b/audio/aidl/default/Bluetooth.cpp
index 38e0c21..bd9a864 100644
--- a/audio/aidl/default/Bluetooth.cpp
+++ b/audio/aidl/default/Bluetooth.cpp
@@ -19,6 +19,7 @@
#include "core-impl/Bluetooth.h"
+using aidl::android::hardware::audio::core::VendorParameter;
using aidl::android::media::audio::common::Boolean;
using aidl::android::media::audio::common::Float;
using aidl::android::media::audio::common::Int;
@@ -79,4 +80,29 @@
return ndk::ScopedAStatus::ok();
}
+ndk::ScopedAStatus BluetoothA2dp::isEnabled(bool* _aidl_return) {
+ *_aidl_return = mEnabled;
+ LOG(DEBUG) << __func__ << ": returning " << *_aidl_return;
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus BluetoothA2dp::setEnabled(bool in_enabled) {
+ mEnabled = in_enabled;
+ LOG(DEBUG) << __func__ << ": " << mEnabled;
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus BluetoothA2dp::supportsOffloadReconfiguration(bool* _aidl_return) {
+ *_aidl_return = true;
+ LOG(DEBUG) << __func__ << ": returning " << *_aidl_return;
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus BluetoothA2dp::reconfigureOffload(
+ const std::vector<::aidl::android::hardware::audio::core::VendorParameter>& in_parameters
+ __unused) {
+ LOG(DEBUG) << __func__ << ": " << ::android::internal::ToString(in_parameters);
+ return ndk::ScopedAStatus::ok();
+}
+
} // namespace aidl::android::hardware::audio::core
diff --git a/audio/aidl/default/Module.cpp b/audio/aidl/default/Module.cpp
index 5440b8d..c4f3844 100644
--- a/audio/aidl/default/Module.cpp
+++ b/audio/aidl/default/Module.cpp
@@ -370,29 +370,32 @@
}
ndk::ScopedAStatus Module::getTelephony(std::shared_ptr<ITelephony>* _aidl_return) {
- if (mTelephony == nullptr) {
+ if (!mTelephony) {
mTelephony = ndk::SharedRefBase::make<Telephony>();
- mTelephonyBinder = mTelephony->asBinder();
- AIBinder_setMinSchedulerPolicy(mTelephonyBinder.get(), SCHED_NORMAL,
- ANDROID_PRIORITY_AUDIO);
}
- *_aidl_return = mTelephony;
+ *_aidl_return = mTelephony.getPtr();
LOG(DEBUG) << __func__ << ": returning instance of ITelephony: " << _aidl_return->get();
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus Module::getBluetooth(std::shared_ptr<IBluetooth>* _aidl_return) {
- if (mBluetooth == nullptr) {
+ if (!mBluetooth) {
mBluetooth = ndk::SharedRefBase::make<Bluetooth>();
- mBluetoothBinder = mBluetooth->asBinder();
- AIBinder_setMinSchedulerPolicy(mBluetoothBinder.get(), SCHED_NORMAL,
- ANDROID_PRIORITY_AUDIO);
}
- *_aidl_return = mBluetooth;
+ *_aidl_return = mBluetooth.getPtr();
LOG(DEBUG) << __func__ << ": returning instance of IBluetooth: " << _aidl_return->get();
return ndk::ScopedAStatus::ok();
}
+ndk::ScopedAStatus Module::getBluetoothA2dp(std::shared_ptr<IBluetoothA2dp>* _aidl_return) {
+ if (!mBluetoothA2dp) {
+ mBluetoothA2dp = ndk::SharedRefBase::make<BluetoothA2dp>();
+ }
+ *_aidl_return = mBluetoothA2dp.getPtr();
+ LOG(DEBUG) << __func__ << ": returning instance of IBluetoothA2dp: " << _aidl_return->get();
+ return ndk::ScopedAStatus::ok();
+}
+
ndk::ScopedAStatus Module::connectExternalDevice(const AudioPort& in_templateIdAndAdditionalData,
AudioPort* _aidl_return) {
const int32_t templateId = in_templateIdAndAdditionalData.id;
@@ -457,6 +460,7 @@
connectedPort.profiles = connectedProfilesIt->second;
}
ports.push_back(connectedPort);
+ onExternalDeviceConnectionChanged(connectedPort, true /*connected*/);
*_aidl_return = std::move(connectedPort);
std::vector<AudioRoute> newRoutes;
@@ -510,6 +514,7 @@
<< configIt->id;
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
}
+ onExternalDeviceConnectionChanged(*portIt, false /*connected*/);
ports.erase(portIt);
mConnectedDevicePorts.erase(in_portId);
LOG(DEBUG) << __func__ << ": connected device port " << in_portId << " released";
@@ -980,8 +985,17 @@
ndk::ScopedAStatus Module::setMasterMute(bool in_mute) {
LOG(DEBUG) << __func__ << ": " << in_mute;
- mMasterMute = in_mute;
- return ndk::ScopedAStatus::ok();
+ auto result = mDebug.simulateDeviceConnections ? ndk::ScopedAStatus::ok()
+ : onMasterMuteChanged(in_mute);
+ if (result.isOk()) {
+ mMasterMute = in_mute;
+ } else {
+ LOG(ERROR) << __func__ << ": failed calling onMasterMuteChanged(" << in_mute
+ << "), error=" << result;
+ // Reset master mute if it failed.
+ onMasterMuteChanged(mMasterMute);
+ }
+ return std::move(result);
}
ndk::ScopedAStatus Module::getMasterVolume(float* _aidl_return) {
@@ -993,8 +1007,17 @@
ndk::ScopedAStatus Module::setMasterVolume(float in_volume) {
LOG(DEBUG) << __func__ << ": " << in_volume;
if (in_volume >= 0.0f && in_volume <= 1.0f) {
- mMasterVolume = in_volume;
- return ndk::ScopedAStatus::ok();
+ auto result = mDebug.simulateDeviceConnections ? ndk::ScopedAStatus::ok()
+ : onMasterVolumeChanged(in_volume);
+ if (result.isOk()) {
+ mMasterVolume = in_volume;
+ } else {
+ // Reset master volume if it failed.
+ LOG(ERROR) << __func__ << ": failed calling onMasterVolumeChanged(" << in_volume
+ << "), error=" << result;
+ onMasterVolumeChanged(mMasterVolume);
+ }
+ return std::move(result);
}
LOG(ERROR) << __func__ << ": invalid master volume value: " << in_volume;
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
@@ -1039,13 +1062,10 @@
}
ndk::ScopedAStatus Module::getSoundDose(std::shared_ptr<ISoundDose>* _aidl_return) {
- if (mSoundDose == nullptr) {
+ if (!mSoundDose) {
mSoundDose = ndk::SharedRefBase::make<sounddose::SoundDose>();
- mSoundDoseBinder = mSoundDose->asBinder();
- AIBinder_setMinSchedulerPolicy(mSoundDoseBinder.get(), SCHED_NORMAL,
- ANDROID_PRIORITY_AUDIO);
}
- *_aidl_return = mSoundDose;
+ *_aidl_return = mSoundDose.getPtr();
LOG(DEBUG) << __func__ << ": returning instance of ISoundDose: " << _aidl_return->get();
return ndk::ScopedAStatus::ok();
}
@@ -1251,14 +1271,30 @@
}
ndk::ScopedAStatus Module::populateConnectedDevicePort(AudioPort* audioPort __unused) {
- LOG(DEBUG) << __func__ << ": do nothing and return ok";
+ LOG(VERBOSE) << __func__ << ": do nothing and return ok";
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus Module::checkAudioPatchEndpointsMatch(
const std::vector<AudioPortConfig*>& sources __unused,
const std::vector<AudioPortConfig*>& sinks __unused) {
- LOG(DEBUG) << __func__ << ": do nothing and return ok";
+ LOG(VERBOSE) << __func__ << ": do nothing and return ok";
+ return ndk::ScopedAStatus::ok();
+}
+
+void Module::onExternalDeviceConnectionChanged(
+ const ::aidl::android::media::audio::common::AudioPort& audioPort __unused,
+ bool connected __unused) {
+ LOG(DEBUG) << __func__ << ": do nothing and return";
+}
+
+ndk::ScopedAStatus Module::onMasterMuteChanged(bool mute __unused) {
+ LOG(VERBOSE) << __func__ << ": do nothing and return ok";
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Module::onMasterVolumeChanged(float volume __unused) {
+ LOG(VERBOSE) << __func__ << ": do nothing and return ok";
return ndk::ScopedAStatus::ok();
}
diff --git a/audio/aidl/default/Stream.cpp b/audio/aidl/default/Stream.cpp
index 49ad2f2..871480b 100644
--- a/audio/aidl/default/Stream.cpp
+++ b/audio/aidl/default/Stream.cpp
@@ -24,6 +24,7 @@
#include "core-impl/Module.h"
#include "core-impl/Stream.h"
+using aidl::android::hardware::audio::common::AudioOffloadMetadata;
using aidl::android::hardware::audio::common::SinkMetadata;
using aidl::android::hardware::audio::common::SourceMetadata;
using aidl::android::media::audio::common::AudioDevice;
@@ -659,6 +660,16 @@
}
template <class Metadata>
+ndk::ScopedAStatus StreamCommonImpl<Metadata>::prepareToClose() {
+ LOG(DEBUG) << __func__;
+ if (!isClosed()) {
+ return ndk::ScopedAStatus::ok();
+ }
+ LOG(ERROR) << __func__ << ": stream was closed";
+ return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
+}
+
+template <class Metadata>
void StreamCommonImpl<Metadata>::stopWorker() {
if (auto commandMQ = mContext.getCommandMQ(); commandMQ != nullptr) {
LOG(DEBUG) << __func__ << ": asking the worker to exit...";
@@ -785,6 +796,40 @@
LOG(DEBUG) << __func__;
}
+ndk::ScopedAStatus StreamOut::updateOffloadMetadata(
+ const AudioOffloadMetadata& in_offloadMetadata) {
+ LOG(DEBUG) << __func__;
+ if (isClosed()) {
+ LOG(ERROR) << __func__ << ": stream was closed";
+ return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
+ }
+ if (!mOffloadInfo.has_value()) {
+ LOG(ERROR) << __func__ << ": not a compressed offload stream";
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+ }
+ if (in_offloadMetadata.sampleRate < 0) {
+ LOG(ERROR) << __func__ << ": invalid sample rate value: " << in_offloadMetadata.sampleRate;
+ return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
+ }
+ if (in_offloadMetadata.averageBitRatePerSecond < 0) {
+ LOG(ERROR) << __func__
+ << ": invalid average BPS value: " << in_offloadMetadata.averageBitRatePerSecond;
+ return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
+ }
+ if (in_offloadMetadata.delayFrames < 0) {
+ LOG(ERROR) << __func__
+ << ": invalid delay frames value: " << in_offloadMetadata.delayFrames;
+ return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
+ }
+ if (in_offloadMetadata.paddingFrames < 0) {
+ LOG(ERROR) << __func__
+ << ": invalid padding frames value: " << in_offloadMetadata.paddingFrames;
+ return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
+ }
+ mOffloadMetadata = in_offloadMetadata;
+ return ndk::ScopedAStatus::ok();
+}
+
ndk::ScopedAStatus StreamOut::getHwVolume(std::vector<float>* _aidl_return) {
LOG(DEBUG) << __func__;
(void)_aidl_return;
diff --git a/audio/aidl/default/audio_effects_config.xml b/audio/aidl/default/audio_effects_config.xml
index 0d1731f..c06742d 100644
--- a/audio/aidl/default/audio_effects_config.xml
+++ b/audio/aidl/default/audio_effects_config.xml
@@ -69,8 +69,6 @@
-->
<effects>
- <effect name="acoustic_echo_canceler" library="pre_processing" uuid="bb392ec0-8d4d-11e0-a896-0002a5d5c51b"/>
- <effect name="automatic_gain_control_v1" library="pre_processing" uuid="aa8130e0-66fc-11e0-bad0-0002a5d5c51b"/>
<effect name="automatic_gain_control_v2" library="pre_processing" uuid="89f38e65-d4d2-4d64-ad0e-2b3e799ea886"/>
<effectProxy name="bassboost" uuid="14804144-a5ee-4d24-aa88-0002a5d5c51b">
<libsw library="bassboostsw" uuid="fa8181f2-588b-11ed-9b6a-0242ac120002"/>
@@ -81,7 +79,6 @@
<effect name="haptic_generator" library="haptic_generator" uuid="97c4acd1-8b82-4f2f-832e-c2fe5d7a9931"/>
<effect name="loudness_enhancer" library="loudness_enhancer" uuid="fa415329-2034-4bea-b5dc-5b381c8d1e2c"/>
<effect name="env_reverb" library="env_reverbsw" uuid="fa819886-588b-11ed-9b6a-0242ac120002"/>
- <effect name="noise_suppression" library="pre_processing" uuid="c06c8400-8e06-11e0-9cb6-0002a5d5c51b"/>
<effect name="preset_reverb" library="preset_reverbsw" uuid="fa8199c6-588b-11ed-9b6a-0242ac120002"/>
<effect name="reverb_env_aux" library="reverb" uuid="4a387fc0-8ab3-11df-8bad-0002a5d5c51b"/>
<effect name="reverb_env_ins" library="reverb" uuid="c7a511a0-a3bb-11df-860e-0002a5d5c51b"/>
diff --git a/audio/aidl/default/dynamicProcessing/DynamicsProcessingSw.cpp b/audio/aidl/default/dynamicProcessing/DynamicsProcessingSw.cpp
index da6d0c6..5e5c974 100644
--- a/audio/aidl/default/dynamicProcessing/DynamicsProcessingSw.cpp
+++ b/audio/aidl/default/dynamicProcessing/DynamicsProcessingSw.cpp
@@ -170,7 +170,7 @@
EX_ILLEGAL_ARGUMENT, "inputGainCfgFailed");
return ndk::ScopedAStatus::ok();
}
- case DynamicsProcessing::vendorExtension: {
+ case DynamicsProcessing::vendor: {
LOG(ERROR) << __func__ << " unsupported tag: " << toString(tag);
return ndk::ScopedAStatus::fromExceptionCodeWithMessage(
EX_ILLEGAL_ARGUMENT, "DynamicsProcessingTagNotSupported");
@@ -237,7 +237,7 @@
dpParam.set<DynamicsProcessing::inputGain>(mContext->getInputGainCfgs());
break;
}
- case DynamicsProcessing::vendorExtension: {
+ case DynamicsProcessing::vendor: {
LOG(ERROR) << __func__ << " unsupported tag: " << toString(tag);
return ndk::ScopedAStatus::fromExceptionCodeWithMessage(
EX_ILLEGAL_ARGUMENT, "DynamicsProcessingTagNotSupported");
diff --git a/audio/aidl/default/extension/ExtensionEffect.cpp b/audio/aidl/default/extension/ExtensionEffect.cpp
index d2e3ccd..c4e4999 100644
--- a/audio/aidl/default/extension/ExtensionEffect.cpp
+++ b/audio/aidl/default/extension/ExtensionEffect.cpp
@@ -88,7 +88,7 @@
std::optional<DefaultExtension> defaultExt;
RETURN_IF(STATUS_OK != vendorEffect.extension.getParcelable(&defaultExt), EX_ILLEGAL_ARGUMENT,
"getParcelableFailed");
- RETURN_IF(!defaultExt.has_value(), EX_ILLEGAL_ARGUMENT, "parcelableNulld");
+ RETURN_IF(!defaultExt.has_value(), EX_ILLEGAL_ARGUMENT, "parcelableNull");
RETURN_IF(mContext->setParams(defaultExt->bytes) != RetCode::SUCCESS, EX_ILLEGAL_ARGUMENT,
"paramNotSupported");
@@ -99,10 +99,15 @@
Parameter::Specific* specific) {
auto tag = id.getTag();
RETURN_IF(Parameter::Id::vendorEffectTag != tag, EX_ILLEGAL_ARGUMENT, "wrongIdTag");
- auto specificId = id.get<Parameter::Id::vendorEffectTag>();
+ auto extensionId = id.get<Parameter::Id::vendorEffectTag>();
+ std::optional<DefaultExtension> defaultIdExt;
+ RETURN_IF(STATUS_OK != extensionId.extension.getParcelable(&defaultIdExt), EX_ILLEGAL_ARGUMENT,
+ "getIdParcelableFailed");
+ RETURN_IF(!defaultIdExt.has_value(), EX_ILLEGAL_ARGUMENT, "parcelableIdNull");
+
VendorExtension extension;
DefaultExtension defaultExt;
- defaultExt.bytes = mContext->getParams(specificId);
+ defaultExt.bytes = mContext->getParams(defaultIdExt->bytes);
RETURN_IF(STATUS_OK != extension.extension.setParcelable(defaultExt), EX_ILLEGAL_ARGUMENT,
"setParcelableFailed");
specific->set<Parameter::Specific::vendorEffect>(extension);
diff --git a/audio/aidl/default/extension/ExtensionEffect.h b/audio/aidl/default/extension/ExtensionEffect.h
index 399fa83..f432d40 100644
--- a/audio/aidl/default/extension/ExtensionEffect.h
+++ b/audio/aidl/default/extension/ExtensionEffect.h
@@ -37,7 +37,7 @@
mParams = params;
return RetCode::SUCCESS;
}
- std::vector<uint8_t> getParams(int tag __unused) const { return mParams; }
+ std::vector<uint8_t> getParams(std::vector<uint8_t> id __unused) const { return mParams; }
private:
std::vector<uint8_t> mParams;
diff --git a/audio/aidl/default/include/core-impl/Bluetooth.h b/audio/aidl/default/include/core-impl/Bluetooth.h
index f2e762d..e2f48ba 100644
--- a/audio/aidl/default/include/core-impl/Bluetooth.h
+++ b/audio/aidl/default/include/core-impl/Bluetooth.h
@@ -17,6 +17,7 @@
#pragma once
#include <aidl/android/hardware/audio/core/BnBluetooth.h>
+#include <aidl/android/hardware/audio/core/BnBluetoothA2dp.h>
namespace aidl::android::hardware::audio::core {
@@ -32,4 +33,19 @@
HfpConfig mHfpConfig;
};
+class BluetoothA2dp : public BnBluetoothA2dp {
+ public:
+ BluetoothA2dp() = default;
+
+ private:
+ ndk::ScopedAStatus isEnabled(bool* _aidl_return) override;
+ ndk::ScopedAStatus setEnabled(bool in_enabled) override;
+ ndk::ScopedAStatus supportsOffloadReconfiguration(bool* _aidl_return) override;
+ ndk::ScopedAStatus reconfigureOffload(
+ const std::vector<::aidl::android::hardware::audio::core::VendorParameter>&
+ in_parameters) override;
+
+ bool mEnabled = false;
+};
+
} // namespace aidl::android::hardware::audio::core
diff --git a/audio/aidl/default/include/core-impl/Module.h b/audio/aidl/default/include/core-impl/Module.h
index 8365b34..c35025f 100644
--- a/audio/aidl/default/include/core-impl/Module.h
+++ b/audio/aidl/default/include/core-impl/Module.h
@@ -46,11 +46,32 @@
bool forceTransientBurst = false;
bool forceSynchronousDrain = false;
};
+ // Helper used for interfaces that require a persistent instance. We hold them via a strong
+ // pointer. The binder token is retained for a call to 'setMinSchedulerPolicy'.
+ template <class C>
+ struct ChildInterface : private std::pair<std::shared_ptr<C>, ndk::SpAIBinder> {
+ ChildInterface() {}
+ ChildInterface& operator=(const std::shared_ptr<C>& c) {
+ return operator=(std::shared_ptr<C>(c));
+ }
+ ChildInterface& operator=(std::shared_ptr<C>&& c) {
+ this->first = std::move(c);
+ this->second = this->first->asBinder();
+ AIBinder_setMinSchedulerPolicy(this->second.get(), SCHED_NORMAL,
+ ANDROID_PRIORITY_AUDIO);
+ return *this;
+ }
+ explicit operator bool() const { return !!this->first; }
+ C& operator*() const { return *(this->first); }
+ C* operator->() const { return this->first; }
+ std::shared_ptr<C> getPtr() const { return this->first; }
+ };
ndk::ScopedAStatus setModuleDebug(
const ::aidl::android::hardware::audio::core::ModuleDebug& in_debug) override;
ndk::ScopedAStatus getTelephony(std::shared_ptr<ITelephony>* _aidl_return) override;
ndk::ScopedAStatus getBluetooth(std::shared_ptr<IBluetooth>* _aidl_return) override;
+ ndk::ScopedAStatus getBluetoothA2dp(std::shared_ptr<IBluetoothA2dp>* _aidl_return) override;
ndk::ScopedAStatus connectExternalDevice(
const ::aidl::android::media::audio::common::AudioPort& in_templateIdAndAdditionalData,
::aidl::android::media::audio::common::AudioPort* _aidl_return) override;
@@ -151,23 +172,17 @@
std::unique_ptr<internal::Configuration> mConfig;
ModuleDebug mDebug;
VendorDebug mVendorDebug;
- // For the interfaces requiring to return the same instance, we need to hold them
- // via a strong pointer. The binder token is retained for a call to 'setMinSchedulerPolicy'.
- std::shared_ptr<ITelephony> mTelephony;
- ndk::SpAIBinder mTelephonyBinder;
- std::shared_ptr<IBluetooth> mBluetooth;
- ndk::SpAIBinder mBluetoothBinder;
+ ChildInterface<ITelephony> mTelephony;
+ ChildInterface<IBluetooth> mBluetooth;
+ ChildInterface<IBluetoothA2dp> mBluetoothA2dp;
// ids of ports created at runtime via 'connectExternalDevice'.
std::set<int32_t> mConnectedDevicePorts;
Streams mStreams;
// Maps port ids and port config ids to patch ids.
// Multimap because both ports and configs can be used by multiple patches.
std::multimap<int32_t, int32_t> mPatches;
- bool mMasterMute = false;
- float mMasterVolume = 1.0f;
bool mMicMute = false;
- std::shared_ptr<sounddose::ISoundDose> mSoundDose;
- ndk::SpAIBinder mSoundDoseBinder;
+ ChildInterface<sounddose::ISoundDose> mSoundDose;
std::optional<bool> mIsMmapSupported;
protected:
@@ -180,6 +195,13 @@
virtual ndk::ScopedAStatus checkAudioPatchEndpointsMatch(
const std::vector<::aidl::android::media::audio::common::AudioPortConfig*>& sources,
const std::vector<::aidl::android::media::audio::common::AudioPortConfig*>& sinks);
+ virtual void onExternalDeviceConnectionChanged(
+ const ::aidl::android::media::audio::common::AudioPort& audioPort, bool connected);
+ virtual ndk::ScopedAStatus onMasterMuteChanged(bool mute);
+ virtual ndk::ScopedAStatus onMasterVolumeChanged(float volume);
+
+ bool mMasterMute = false;
+ float mMasterVolume = 1.0f;
};
} // namespace aidl::android::hardware::audio::core
diff --git a/audio/aidl/default/include/core-impl/ModuleUsb.h b/audio/aidl/default/include/core-impl/ModuleUsb.h
index 7b177e8..1aa2244 100644
--- a/audio/aidl/default/include/core-impl/ModuleUsb.h
+++ b/audio/aidl/default/include/core-impl/ModuleUsb.h
@@ -28,10 +28,6 @@
// IModule interfaces
ndk::ScopedAStatus getTelephony(std::shared_ptr<ITelephony>* _aidl_return) override;
ndk::ScopedAStatus getBluetooth(std::shared_ptr<IBluetooth>* _aidl_return) override;
- ndk::ScopedAStatus getMasterMute(bool* _aidl_return) override;
- ndk::ScopedAStatus setMasterMute(bool in_mute) override;
- ndk::ScopedAStatus getMasterVolume(float* _aidl_return) override;
- ndk::ScopedAStatus setMasterVolume(float in_volume) override;
ndk::ScopedAStatus getMicMute(bool* _aidl_return) override;
ndk::ScopedAStatus setMicMute(bool in_mute) override;
@@ -42,6 +38,11 @@
const std::vector<::aidl::android::media::audio::common::AudioPortConfig*>& sources,
const std::vector<::aidl::android::media::audio::common::AudioPortConfig*>& sinks)
override;
+ void onExternalDeviceConnectionChanged(
+ const ::aidl::android::media::audio::common::AudioPort& audioPort,
+ bool connected) override;
+ ndk::ScopedAStatus onMasterMuteChanged(bool mute) override;
+ ndk::ScopedAStatus onMasterVolumeChanged(float volume) override;
};
} // namespace aidl::android::hardware::audio::core
diff --git a/audio/aidl/default/include/core-impl/Stream.h b/audio/aidl/default/include/core-impl/Stream.h
index 0d4365a3..65680df 100644
--- a/audio/aidl/default/include/core-impl/Stream.h
+++ b/audio/aidl/default/include/core-impl/Stream.h
@@ -294,6 +294,7 @@
struct StreamCommonInterface {
virtual ~StreamCommonInterface() = default;
virtual ndk::ScopedAStatus close() = 0;
+ virtual ndk::ScopedAStatus prepareToClose() = 0;
virtual ndk::ScopedAStatus updateHwAvSyncId(int32_t in_hwAvSyncId) = 0;
virtual ndk::ScopedAStatus getVendorParameters(const std::vector<std::string>& in_ids,
std::vector<VendorParameter>* _aidl_return) = 0;
@@ -318,6 +319,11 @@
return delegate != nullptr ? delegate->close()
: ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
}
+ ndk::ScopedAStatus prepareToClose() override {
+ auto delegate = mDelegate.lock();
+ return delegate != nullptr ? delegate->prepareToClose()
+ : ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
+ }
ndk::ScopedAStatus updateHwAvSyncId(int32_t in_hwAvSyncId) override {
auto delegate = mDelegate.lock();
return delegate != nullptr ? delegate->updateHwAvSyncId(in_hwAvSyncId)
@@ -359,6 +365,7 @@
class StreamCommonImpl : public StreamCommonInterface {
public:
ndk::ScopedAStatus close() override;
+ ndk::ScopedAStatus prepareToClose() override;
ndk::ScopedAStatus updateHwAvSyncId(int32_t in_hwAvSyncId) override;
ndk::ScopedAStatus getVendorParameters(const std::vector<std::string>& in_ids,
std::vector<VendorParameter>* _aidl_return) override;
@@ -463,6 +470,9 @@
return StreamCommonImpl<::aidl::android::hardware::audio::common::SourceMetadata>::
updateMetadata(in_sourceMetadata);
}
+ ndk::ScopedAStatus updateOffloadMetadata(
+ const ::aidl::android::hardware::audio::common::AudioOffloadMetadata&
+ in_offloadMetadata) override;
ndk::ScopedAStatus getHwVolume(std::vector<float>* _aidl_return) override;
ndk::ScopedAStatus setHwVolume(const std::vector<float>& in_channelVolumes) override;
ndk::ScopedAStatus getAudioDescriptionMixLevel(float* _aidl_return) override;
@@ -500,6 +510,7 @@
offloadInfo);
std::optional<::aidl::android::media::audio::common::AudioOffloadInfo> mOffloadInfo;
+ std::optional<::aidl::android::hardware::audio::common::AudioOffloadMetadata> mOffloadMetadata;
public:
using CreateInstance = std::function<ndk::ScopedAStatus(
diff --git a/audio/aidl/default/include/core-impl/StreamUsb.h b/audio/aidl/default/include/core-impl/StreamUsb.h
index c04dc66..f1815dd 100644
--- a/audio/aidl/default/include/core-impl/StreamUsb.h
+++ b/audio/aidl/default/include/core-impl/StreamUsb.h
@@ -17,6 +17,7 @@
#pragma once
#include <mutex>
+#include <vector>
#include <aidl/android/media/audio/common/AudioChannelLayout.h>
@@ -93,6 +94,12 @@
StreamContext&& context,
const std::optional<::aidl::android::media::audio::common::AudioOffloadInfo>&
offloadInfo);
+
+ ndk::ScopedAStatus getHwVolume(std::vector<float>* _aidl_return) override;
+ ndk::ScopedAStatus setHwVolume(const std::vector<float>& in_channelVolumes) override;
+
+ int mChannelCount;
+ std::vector<float> mHwVolumes;
};
} // namespace aidl::android::hardware::audio::core
diff --git a/audio/aidl/default/usb/ModuleUsb.cpp b/audio/aidl/default/usb/ModuleUsb.cpp
index e803420..511ba74 100644
--- a/audio/aidl/default/usb/ModuleUsb.cpp
+++ b/audio/aidl/default/usb/ModuleUsb.cpp
@@ -22,6 +22,7 @@
#include <android-base/logging.h>
#include <tinyalsa/asoundlib.h>
+#include "UsbAlsaMixerControl.h"
#include "UsbAlsaUtils.h"
#include "core-impl/ModuleUsb.h"
@@ -86,26 +87,6 @@
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus ModuleUsb::getMasterMute(bool* _aidl_return __unused) {
- LOG(DEBUG) << __func__ << ": is not supported";
- return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
-}
-
-ndk::ScopedAStatus ModuleUsb::setMasterMute(bool in_mute __unused) {
- LOG(DEBUG) << __func__ << ": is not supported";
- return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
-}
-
-ndk::ScopedAStatus ModuleUsb::getMasterVolume(float* _aidl_return __unused) {
- LOG(DEBUG) << __func__ << ": is not supported";
- return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
-}
-
-ndk::ScopedAStatus ModuleUsb::setMasterVolume(float in_volume __unused) {
- LOG(DEBUG) << __func__ << ": is not supported";
- return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
-}
-
ndk::ScopedAStatus ModuleUsb::getMicMute(bool* _aidl_return __unused) {
LOG(DEBUG) << __func__ << ": is not supported";
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
@@ -180,4 +161,26 @@
return ndk::ScopedAStatus::ok();
}
+void ModuleUsb::onExternalDeviceConnectionChanged(
+ const ::aidl::android::media::audio::common::AudioPort& audioPort, bool connected) {
+ if (audioPort.ext.getTag() != AudioPortExt::Tag::device) {
+ return;
+ }
+ const auto& address = audioPort.ext.get<AudioPortExt::Tag::device>().device.address;
+ if (address.getTag() != AudioDeviceAddress::alsa) {
+ return;
+ }
+ const int card = address.get<AudioDeviceAddress::alsa>()[0];
+ usb::UsbAlsaMixerControl::getInstance().setDeviceConnectionState(card, mMasterMute,
+ mMasterVolume, connected);
+}
+
+ndk::ScopedAStatus ModuleUsb::onMasterMuteChanged(bool mute) {
+ return usb::UsbAlsaMixerControl::getInstance().setMasterMute(mute);
+}
+
+ndk::ScopedAStatus ModuleUsb::onMasterVolumeChanged(float volume) {
+ return usb::UsbAlsaMixerControl::getInstance().setMasterVolume(volume);
+}
+
} // namespace aidl::android::hardware::audio::core
diff --git a/audio/aidl/default/usb/StreamUsb.cpp b/audio/aidl/default/usb/StreamUsb.cpp
index bd53a0e..d6f757c 100644
--- a/audio/aidl/default/usb/StreamUsb.cpp
+++ b/audio/aidl/default/usb/StreamUsb.cpp
@@ -17,6 +17,9 @@
#define LOG_TAG "AHAL_StreamUsb"
#include <android-base/logging.h>
+#include <Utils.h>
+
+#include "UsbAlsaMixerControl.h"
#include "UsbAlsaUtils.h"
#include "core-impl/Module.h"
#include "core-impl/StreamUsb.h"
@@ -30,8 +33,12 @@
using aidl::android::media::audio::common::AudioDevice;
using aidl::android::media::audio::common::AudioDeviceAddress;
using aidl::android::media::audio::common::AudioOffloadInfo;
+using aidl::android::media::audio::common::AudioPortExt;
using aidl::android::media::audio::common::MicrophoneDynamicInfo;
using aidl::android::media::audio::common::MicrophoneInfo;
+using android::OK;
+using android::status_t;
+using android::hardware::audio::common::getChannelCount;
namespace aidl::android::hardware::audio::core {
@@ -239,6 +246,31 @@
// The default worker implementation is used.
return new StreamOutWorker(ctx, driver);
},
- offloadInfo) {}
+ offloadInfo) {
+ mChannelCount = getChannelCount(mContext.getChannelLayout());
+}
+
+ndk::ScopedAStatus StreamOutUsb::getHwVolume(std::vector<float>* _aidl_return) {
+ *_aidl_return = mHwVolumes;
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus StreamOutUsb::setHwVolume(const std::vector<float>& in_channelVolumes) {
+ for (const auto& device : mConnectedDevices) {
+ if (device.address.getTag() != AudioDeviceAddress::alsa) {
+ LOG(DEBUG) << __func__ << ": skip as the device address is not alsa";
+ continue;
+ }
+ const int card = device.address.get<AudioDeviceAddress::alsa>()[0];
+ if (auto result =
+ usb::UsbAlsaMixerControl::getInstance().setVolumes(card, in_channelVolumes);
+ !result.isOk()) {
+ LOG(ERROR) << __func__ << ": failed to set volume for device, card=" << card;
+ return result;
+ }
+ }
+ mHwVolumes = in_channelVolumes;
+ return ndk::ScopedAStatus::ok();
+}
} // namespace aidl::android::hardware::audio::core
diff --git a/audio/aidl/default/usb/UsbAlsaMixerControl.cpp b/audio/aidl/default/usb/UsbAlsaMixerControl.cpp
new file mode 100644
index 0000000..b5337d1
--- /dev/null
+++ b/audio/aidl/default/usb/UsbAlsaMixerControl.cpp
@@ -0,0 +1,239 @@
+/*
+ * 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.
+ */
+
+#define LOG_TAG "AHAL_UsbAlsaMixerControl"
+#include <android-base/logging.h>
+
+#include <cmath>
+#include <string>
+#include <vector>
+
+#include <android/binder_status.h>
+
+#include "UsbAlsaMixerControl.h"
+
+namespace aidl::android::hardware::audio::core::usb {
+
+//-----------------------------------------------------------------------------
+
+MixerControl::MixerControl(struct mixer_ctl* ctl)
+ : mCtl(ctl),
+ mNumValues(mixer_ctl_get_num_values(ctl)),
+ mMinValue(mixer_ctl_get_range_min(ctl)),
+ mMaxValue(mixer_ctl_get_range_max(ctl)) {}
+
+unsigned int MixerControl::getNumValues() const {
+ return mNumValues;
+}
+
+int MixerControl::getMaxValue() const {
+ return mMaxValue;
+}
+
+int MixerControl::getMinValue() const {
+ return mMinValue;
+}
+
+int MixerControl::setArray(const void* array, size_t count) {
+ const std::lock_guard guard(mLock);
+ return mixer_ctl_set_array(mCtl, array, count);
+}
+
+//-----------------------------------------------------------------------------
+
+// static
+const std::map<AlsaMixer::Control, std::vector<AlsaMixer::ControlNamesAndExpectedCtlType>>
+ AlsaMixer::kPossibleControls = {
+ {AlsaMixer::MASTER_SWITCH, {{"Master Playback Switch", MIXER_CTL_TYPE_BOOL}}},
+ {AlsaMixer::MASTER_VOLUME, {{"Master Playback Volume", MIXER_CTL_TYPE_INT}}},
+ {AlsaMixer::HW_VOLUME,
+ {{"Headphone Playback Volume", MIXER_CTL_TYPE_INT},
+ {"Headset Playback Volume", MIXER_CTL_TYPE_INT},
+ {"PCM Playback Volume", MIXER_CTL_TYPE_INT}}}};
+
+// static
+std::map<AlsaMixer::Control, std::shared_ptr<MixerControl>> AlsaMixer::initializeMixerControls(
+ struct mixer* mixer) {
+ std::map<AlsaMixer::Control, std::shared_ptr<MixerControl>> mixerControls;
+ std::string mixerCtlNames;
+ for (const auto& [control, possibleCtls] : kPossibleControls) {
+ for (const auto& [ctlName, expectedCtlType] : possibleCtls) {
+ struct mixer_ctl* ctl = mixer_get_ctl_by_name(mixer, ctlName.c_str());
+ if (ctl != nullptr && mixer_ctl_get_type(ctl) == expectedCtlType) {
+ mixerControls.emplace(control, std::make_unique<MixerControl>(ctl));
+ if (!mixerCtlNames.empty()) {
+ mixerCtlNames += ",";
+ }
+ mixerCtlNames += ctlName;
+ break;
+ }
+ }
+ }
+ LOG(DEBUG) << __func__ << ": available mixer control names=[" << mixerCtlNames << "]";
+ return mixerControls;
+}
+
+AlsaMixer::AlsaMixer(struct mixer* mixer)
+ : mMixer(mixer), mMixerControls(initializeMixerControls(mMixer)) {}
+
+AlsaMixer::~AlsaMixer() {
+ mixer_close(mMixer);
+}
+
+namespace {
+
+int volumeFloatToInteger(float fValue, int maxValue, int minValue) {
+ return minValue + std::ceil((maxValue - minValue) * fValue);
+}
+
+float volumeIntegerToFloat(int iValue, int maxValue, int minValue) {
+ if (iValue > maxValue) {
+ return 1.0f;
+ }
+ if (iValue < minValue) {
+ return 0.0f;
+ }
+ return static_cast<float>(iValue - minValue) / (maxValue - minValue);
+}
+
+} // namespace
+
+ndk::ScopedAStatus AlsaMixer::setMasterMute(bool muted) {
+ auto it = mMixerControls.find(AlsaMixer::MASTER_SWITCH);
+ if (it == mMixerControls.end()) {
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+ }
+ const int numValues = it->second->getNumValues();
+ std::vector<int> values(numValues, muted ? 0 : 1);
+ if (int err = it->second->setArray(values.data(), numValues); err != 0) {
+ LOG(ERROR) << __func__ << ": failed to set master mute, err=" << err;
+ return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
+ }
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus AlsaMixer::setMasterVolume(float volume) {
+ auto it = mMixerControls.find(AlsaMixer::MASTER_VOLUME);
+ if (it == mMixerControls.end()) {
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+ }
+ const int numValues = it->second->getNumValues();
+ std::vector<int> values(numValues, volumeFloatToInteger(volume, it->second->getMaxValue(),
+ it->second->getMinValue()));
+ if (int err = it->second->setArray(values.data(), numValues); err != 0) {
+ LOG(ERROR) << __func__ << ": failed to set master volume, err=" << err;
+ return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
+ }
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus AlsaMixer::setVolumes(std::vector<float> volumes) {
+ auto it = mMixerControls.find(AlsaMixer::HW_VOLUME);
+ if (it == mMixerControls.end()) {
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+ }
+ const int numValues = it->second->getNumValues();
+ const int maxValue = it->second->getMaxValue();
+ const int minValue = it->second->getMinValue();
+ std::vector<int> values;
+ size_t i = 0;
+ for (; i < numValues && i < values.size(); ++i) {
+ values.emplace_back(volumeFloatToInteger(volumes[i], maxValue, minValue));
+ }
+ if (int err = it->second->setArray(values.data(), values.size()); err != 0) {
+ LOG(ERROR) << __func__ << ": failed to set volume, err=" << err;
+ return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
+ }
+ return ndk::ScopedAStatus::ok();
+}
+
+//-----------------------------------------------------------------------------
+
+// static
+UsbAlsaMixerControl& UsbAlsaMixerControl::getInstance() {
+ static UsbAlsaMixerControl gInstance;
+ return gInstance;
+}
+
+void UsbAlsaMixerControl::setDeviceConnectionState(int card, bool masterMuted, float masterVolume,
+ bool connected) {
+ LOG(DEBUG) << __func__ << ": card=" << card << ", connected=" << connected;
+ if (connected) {
+ struct mixer* mixer = mixer_open(card);
+ if (mixer == nullptr) {
+ PLOG(ERROR) << __func__ << ": failed to open mixer for card=" << card;
+ return;
+ }
+ auto alsaMixer = std::make_shared<AlsaMixer>(mixer);
+ alsaMixer->setMasterMute(masterMuted);
+ alsaMixer->setMasterVolume(masterVolume);
+ const std::lock_guard guard(mLock);
+ mMixerControls.emplace(card, alsaMixer);
+ } else {
+ const std::lock_guard guard(mLock);
+ mMixerControls.erase(card);
+ }
+}
+
+ndk::ScopedAStatus UsbAlsaMixerControl::setMasterMute(bool mute) {
+ auto alsaMixers = getAlsaMixers();
+ for (auto it = alsaMixers.begin(); it != alsaMixers.end(); ++it) {
+ if (auto result = it->second->setMasterMute(mute); !result.isOk()) {
+ // Return illegal state if there are multiple devices connected and one of them fails
+ // to set master mute. Otherwise, return the error from calling `setMasterMute`.
+ LOG(ERROR) << __func__ << ": failed to set master mute for card=" << it->first;
+ return alsaMixers.size() > 1 ? ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE)
+ : std::move(result);
+ }
+ }
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus UsbAlsaMixerControl::setMasterVolume(float volume) {
+ auto alsaMixers = getAlsaMixers();
+ for (auto it = alsaMixers.begin(); it != alsaMixers.end(); ++it) {
+ if (auto result = it->second->setMasterVolume(volume); !result.isOk()) {
+ // Return illegal state if there are multiple devices connected and one of them fails
+ // to set master volume. Otherwise, return the error from calling `setMasterVolume`.
+ LOG(ERROR) << __func__ << ": failed to set master volume for card=" << it->first;
+ return alsaMixers.size() > 1 ? ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE)
+ : std::move(result);
+ }
+ }
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus UsbAlsaMixerControl::setVolumes(int card, std::vector<float> volumes) {
+ auto alsaMixer = getAlsaMixer(card);
+ if (alsaMixer == nullptr) {
+ LOG(ERROR) << __func__ << ": no mixer control found for card=" << card;
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+ }
+ return alsaMixer->setVolumes(volumes);
+}
+
+std::shared_ptr<AlsaMixer> UsbAlsaMixerControl::getAlsaMixer(int card) {
+ const std::lock_guard guard(mLock);
+ const auto it = mMixerControls.find(card);
+ return it == mMixerControls.end() ? nullptr : it->second;
+}
+
+std::map<int, std::shared_ptr<AlsaMixer>> UsbAlsaMixerControl::getAlsaMixers() {
+ const std::lock_guard guard(mLock);
+ return mMixerControls;
+}
+
+} // namespace aidl::android::hardware::audio::core::usb
diff --git a/audio/aidl/default/usb/UsbAlsaMixerControl.h b/audio/aidl/default/usb/UsbAlsaMixerControl.h
new file mode 100644
index 0000000..cbcddd8
--- /dev/null
+++ b/audio/aidl/default/usb/UsbAlsaMixerControl.h
@@ -0,0 +1,106 @@
+/*
+ * 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.
+ */
+
+#pragma once
+
+#include <map>
+#include <memory>
+#include <mutex>
+#include <optional>
+#include <string>
+#include <vector>
+
+#include <android-base/thread_annotations.h>
+#include <android/binder_auto_utils.h>
+
+extern "C" {
+#include <tinyalsa/mixer.h>
+}
+
+namespace aidl::android::hardware::audio::core::usb {
+
+class MixerControl {
+ public:
+ explicit MixerControl(struct mixer_ctl* ctl);
+
+ unsigned int getNumValues() const;
+ int getMaxValue() const;
+ int getMinValue() const;
+ int setArray(const void* array, size_t count);
+
+ private:
+ std::mutex mLock;
+ // The mixer_ctl object is owned by ALSA and will be released when the mixer is closed.
+ struct mixer_ctl* mCtl GUARDED_BY(mLock);
+ const unsigned int mNumValues;
+ const int mMinValue;
+ const int mMaxValue;
+};
+
+class AlsaMixer {
+ public:
+ explicit AlsaMixer(struct mixer* mixer);
+
+ ~AlsaMixer();
+
+ bool isValid() const { return mMixer != nullptr; }
+
+ ndk::ScopedAStatus setMasterMute(bool muted);
+ ndk::ScopedAStatus setMasterVolume(float volume);
+ ndk::ScopedAStatus setVolumes(std::vector<float> volumes);
+
+ private:
+ enum Control {
+ MASTER_SWITCH,
+ MASTER_VOLUME,
+ HW_VOLUME,
+ };
+ using ControlNamesAndExpectedCtlType = std::pair<std::string, enum mixer_ctl_type>;
+ static const std::map<Control, std::vector<ControlNamesAndExpectedCtlType>> kPossibleControls;
+ static std::map<Control, std::shared_ptr<MixerControl>> initializeMixerControls(
+ struct mixer* mixer);
+
+ // The mixer object is owned by ALSA and will be released when the mixer is closed.
+ struct mixer* mMixer;
+ // `mMixerControls` will only be initialized in constructor. After that, it wil only be
+ // read but not be modified.
+ const std::map<Control, std::shared_ptr<MixerControl>> mMixerControls;
+};
+
+class UsbAlsaMixerControl {
+ public:
+ static UsbAlsaMixerControl& getInstance();
+
+ void setDeviceConnectionState(int card, bool masterMuted, float masterVolume, bool connected);
+
+ // Master volume settings will be applied to all sound cards, it is only set by the
+ // USB module.
+ ndk::ScopedAStatus setMasterMute(bool muted);
+ ndk::ScopedAStatus setMasterVolume(float volume);
+ // The volume settings can be different on sound cards. It is controlled by streams.
+ ndk::ScopedAStatus setVolumes(int card, std::vector<float> volumes);
+
+ private:
+ std::shared_ptr<AlsaMixer> getAlsaMixer(int card);
+ std::map<int, std::shared_ptr<AlsaMixer>> getAlsaMixers();
+
+ std::mutex mLock;
+ // A map whose key is the card number and value is a shared pointer to corresponding
+ // AlsaMixer object.
+ std::map<int, std::shared_ptr<AlsaMixer>> mMixerControls GUARDED_BY(mLock);
+};
+
+} // namespace aidl::android::hardware::audio::core::usb
diff --git a/audio/aidl/vts/EffectHelper.h b/audio/aidl/vts/EffectHelper.h
index 5ed8e1f..5e03d67 100644
--- a/audio/aidl/vts/EffectHelper.h
+++ b/audio/aidl/vts/EffectHelper.h
@@ -28,6 +28,7 @@
#include <aidl/android/media/audio/common/AudioChannelLayout.h>
#include <android/binder_auto_utils.h>
#include <fmq/AidlMessageQueue.h>
+#include <gtest/gtest.h>
#include <system/audio_effects/aidl_effects_utils.h>
#include "AudioHalBinderServiceUtil.h"
diff --git a/audio/aidl/vts/ModuleConfig.cpp b/audio/aidl/vts/ModuleConfig.cpp
index 7b002ad..b07edb7 100644
--- a/audio/aidl/vts/ModuleConfig.cpp
+++ b/audio/aidl/vts/ModuleConfig.cpp
@@ -56,7 +56,7 @@
offloadInfo.base.sampleRate = portConfig.sampleRate.value().value;
offloadInfo.base.channelMask = portConfig.channelMask.value();
offloadInfo.base.format = portConfig.format.value();
- offloadInfo.bitRatePerSecond = 256; // Arbitrary value.
+ offloadInfo.bitRatePerSecond = 256000; // Arbitrary value.
offloadInfo.durationUs = std::chrono::microseconds(1min).count(); // Arbitrary value.
offloadInfo.usage = AudioUsage::MEDIA;
offloadInfo.encapsulationMode = AudioEncapsulationMode::NONE;
diff --git a/audio/aidl/vts/TestUtils.h b/audio/aidl/vts/TestUtils.h
index 4c1d42c..72ca56f 100644
--- a/audio/aidl/vts/TestUtils.h
+++ b/audio/aidl/vts/TestUtils.h
@@ -21,7 +21,7 @@
#include <iostream>
#include <android/binder_auto_utils.h>
-#include <gtest/gtest_pred_impl.h>
+#include <gtest/gtest.h>
namespace android::hardware::audio::common::testing {
diff --git a/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp b/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp
index b6015ff..f06c0f1 100644
--- a/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp
@@ -53,6 +53,7 @@
#include "TestUtils.h"
using namespace android;
+using aidl::android::hardware::audio::common::AudioOffloadMetadata;
using aidl::android::hardware::audio::common::PlaybackTrackMetadata;
using aidl::android::hardware::audio::common::RecordTrackMetadata;
using aidl::android::hardware::audio::common::SinkMetadata;
@@ -60,6 +61,7 @@
using aidl::android::hardware::audio::core::AudioPatch;
using aidl::android::hardware::audio::core::AudioRoute;
using aidl::android::hardware::audio::core::IBluetooth;
+using aidl::android::hardware::audio::core::IBluetoothA2dp;
using aidl::android::hardware::audio::core::IModule;
using aidl::android::hardware::audio::core::IStreamCommon;
using aidl::android::hardware::audio::core::IStreamIn;
@@ -401,8 +403,9 @@
// Can be used as a base for any test here, does not depend on the fixture GTest parameters.
class AudioCoreModuleBase {
public:
- // The default buffer size is used mostly for negative tests.
+ // Default buffer sizes are used mostly for negative tests.
static constexpr int kDefaultBufferSizeFrames = 256;
+ static constexpr int kDefaultLargeBufferSizeFrames = 48000;
void SetUpImpl(const std::string& moduleName) {
ASSERT_NO_FATAL_FAILURE(ConnectToService(moduleName));
@@ -1067,6 +1070,8 @@
std::shared_ptr<IStreamCommon> common;
ndk::ScopedAStatus status = stream->getStreamCommon(&common);
if (!status.isOk()) return status;
+ status = common->prepareToClose();
+ if (!status.isOk()) return status;
return common->close();
}
@@ -2053,6 +2058,59 @@
&hfpConfig));
}
+class AudioCoreBluetoothA2dp : public AudioCoreModuleBase,
+ public testing::TestWithParam<std::string> {
+ public:
+ void SetUp() override {
+ ASSERT_NO_FATAL_FAILURE(SetUpImpl(GetParam()));
+ ASSERT_IS_OK(module->getBluetoothA2dp(&bluetooth));
+ }
+
+ void TearDown() override { ASSERT_NO_FATAL_FAILURE(TearDownImpl()); }
+
+ std::shared_ptr<IBluetoothA2dp> bluetooth;
+};
+
+TEST_P(AudioCoreBluetoothA2dp, SameInstance) {
+ if (bluetooth == nullptr) {
+ GTEST_SKIP() << "BluetoothA2dp is not supported";
+ }
+ std::shared_ptr<IBluetoothA2dp> bluetooth2;
+ EXPECT_IS_OK(module->getBluetoothA2dp(&bluetooth2));
+ ASSERT_NE(nullptr, bluetooth2.get());
+ EXPECT_EQ(bluetooth->asBinder(), bluetooth2->asBinder())
+ << "getBluetoothA2dp must return the same interface instance across invocations";
+}
+
+TEST_P(AudioCoreBluetoothA2dp, Enabled) {
+ if (bluetooth == nullptr) {
+ GTEST_SKIP() << "BluetoothA2dp is not supported";
+ }
+ // Since enabling A2DP may require having an actual device connection,
+ // limit testing to setting back the current value.
+ bool enabled;
+ ASSERT_IS_OK(bluetooth->isEnabled(&enabled));
+ EXPECT_IS_OK(bluetooth->setEnabled(enabled))
+ << "setEnabled without actual state change must not fail";
+}
+
+TEST_P(AudioCoreBluetoothA2dp, OffloadReconfiguration) {
+ if (bluetooth == nullptr) {
+ GTEST_SKIP() << "BluetoothA2dp is not supported";
+ }
+ bool isSupported;
+ ASSERT_IS_OK(bluetooth->supportsOffloadReconfiguration(&isSupported));
+ bool isSupported2;
+ ASSERT_IS_OK(bluetooth->supportsOffloadReconfiguration(&isSupported2));
+ EXPECT_EQ(isSupported, isSupported2);
+ if (isSupported) {
+ static const auto kStatuses = {EX_NONE, EX_ILLEGAL_STATE};
+ EXPECT_STATUS(kStatuses, bluetooth->reconfigureOffload({}));
+ } else {
+ EXPECT_STATUS(EX_UNSUPPORTED_OPERATION, bluetooth->reconfigureOffload({}));
+ }
+}
+
class AudioCoreTelephony : public AudioCoreModuleBase, public testing::TestWithParam<std::string> {
public:
void SetUp() override {
@@ -2246,6 +2304,26 @@
<< "when closing the stream twice";
}
+ void PrepareToCloseTwice() {
+ const auto portConfig = moduleConfig->getSingleConfigForMixPort(IOTraits<Stream>::is_input);
+ if (!portConfig.has_value()) {
+ GTEST_SKIP() << "No mix port for attached devices";
+ }
+ std::shared_ptr<IStreamCommon> heldStreamCommon;
+ {
+ WithStream<Stream> stream(portConfig.value());
+ ASSERT_NO_FATAL_FAILURE(stream.SetUp(module.get(), kDefaultBufferSizeFrames));
+ std::shared_ptr<IStreamCommon> streamCommon;
+ ASSERT_IS_OK(stream.get()->getStreamCommon(&streamCommon));
+ heldStreamCommon = streamCommon;
+ EXPECT_IS_OK(streamCommon->prepareToClose());
+ EXPECT_IS_OK(streamCommon->prepareToClose())
+ << "when calling prepareToClose second time";
+ }
+ EXPECT_STATUS(EX_ILLEGAL_STATE, heldStreamCommon->prepareToClose())
+ << "when calling prepareToClose on a closed stream";
+ }
+
void OpenAllConfigs() {
const auto allPortConfigs =
moduleConfig->getPortConfigsForMixPorts(IOTraits<Stream>::is_input);
@@ -2541,6 +2619,7 @@
}
TEST_IN_AND_OUT_STREAM(CloseTwice);
+TEST_IN_AND_OUT_STREAM(PrepareToCloseTwice);
TEST_IN_AND_OUT_STREAM(GetStreamCommon);
TEST_IN_AND_OUT_STREAM(OpenAllConfigs);
TEST_IN_AND_OUT_STREAM(OpenInvalidBufferSize);
@@ -2696,7 +2775,7 @@
aidl::android::hardware::audio::core::IModule::OpenOutputStreamArguments args;
args.portConfigId = portConfig.getId();
args.sourceMetadata = GenerateSourceMetadata(portConfig.get());
- args.bufferSizeFrames = kDefaultBufferSizeFrames;
+ args.bufferSizeFrames = kDefaultLargeBufferSizeFrames;
aidl::android::hardware::audio::core::IModule::OpenOutputStreamReturn ret;
EXPECT_STATUS(EX_ILLEGAL_ARGUMENT, module->openOutputStream(args, &ret))
<< "when no offload info is provided for a compressed offload mix port";
@@ -2876,7 +2955,7 @@
const auto portConfig = moduleConfig->getSingleConfigForMixPort(false, port);
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));
+ ASSERT_NO_FATAL_FAILURE(stream.SetUp(module.get(), kDefaultLargeBufferSizeFrames));
bool isSupported = false;
EXPECT_NO_FATAL_FAILURE(TestAccessors<AudioPlaybackRate>(
stream.get(), &IStreamOut::getPlaybackRateParameters,
@@ -2901,7 +2980,7 @@
const auto portConfig = moduleConfig->getSingleConfigForMixPort(false, port);
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));
+ ASSERT_NO_FATAL_FAILURE(stream.SetUp(module.get(), kDefaultLargeBufferSizeFrames));
ndk::ScopedAStatus status;
EXPECT_STATUS(kStatuses, status = stream.get()->selectPresentation(0, 0));
if (status.getExceptionCode() != EX_UNSUPPORTED_OPERATION) atLeastOneSupports = true;
@@ -2911,6 +2990,33 @@
}
}
+TEST_P(AudioStreamOut, UpdateOffloadMetadata) {
+ const auto offloadMixPorts =
+ moduleConfig->getOffloadMixPorts(true /*attachedOnly*/, false /*singlePort*/);
+ if (offloadMixPorts.empty()) {
+ GTEST_SKIP()
+ << "No mix port for compressed offload that could be routed to attached devices";
+ }
+ for (const auto& port : offloadMixPorts) {
+ const auto portConfig = moduleConfig->getSingleConfigForMixPort(false, port);
+ 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(), kDefaultLargeBufferSizeFrames));
+ AudioOffloadMetadata validMetadata{
+ .sampleRate = portConfig.value().sampleRate.value().value,
+ .channelMask = portConfig.value().channelMask.value(),
+ .averageBitRatePerSecond = 256000,
+ .delayFrames = 0,
+ .paddingFrames = 0};
+ EXPECT_IS_OK(stream.get()->updateOffloadMetadata(validMetadata));
+ AudioOffloadMetadata invalidMetadata{.sampleRate = -1,
+ .averageBitRatePerSecond = -1,
+ .delayFrames = -1,
+ .paddingFrames = -1};
+ EXPECT_STATUS(EX_ILLEGAL_ARGUMENT, stream.get()->updateOffloadMetadata(invalidMetadata));
+ }
+}
+
class StreamLogicDefaultDriver : public StreamLogicDriver {
public:
StreamLogicDefaultDriver(std::shared_ptr<StateSequence> commands, size_t frameSizeBytes)
@@ -3433,6 +3539,10 @@
testing::ValuesIn(android::getAidlHalInstanceNames(IModule::descriptor)),
android::PrintInstanceNameToString);
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(AudioCoreBluetooth);
+INSTANTIATE_TEST_SUITE_P(AudioCoreBluetoothA2dpTest, AudioCoreBluetoothA2dp,
+ testing::ValuesIn(android::getAidlHalInstanceNames(IModule::descriptor)),
+ android::PrintInstanceNameToString);
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(AudioCoreBluetoothA2dp);
INSTANTIATE_TEST_SUITE_P(AudioCoreTelephonyTest, AudioCoreTelephony,
testing::ValuesIn(android::getAidlHalInstanceNames(IModule::descriptor)),
android::PrintInstanceNameToString);
diff --git a/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp b/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp
index ece07f0..3e6fa7a 100644
--- a/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp
+++ b/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp
@@ -224,7 +224,7 @@
dpRef.get<DynamicsProcessing::inputGain>(),
dpTest.get<DynamicsProcessing::inputGain>());
}
- case DynamicsProcessing::vendorExtension: {
+ case DynamicsProcessing::vendor: {
return false;
}
}
diff --git a/automotive/audiocontrol/aidl/vts/Android.bp b/automotive/audiocontrol/aidl/vts/Android.bp
index a9122ce..cfc2a3e 100644
--- a/automotive/audiocontrol/aidl/vts/Android.bp
+++ b/automotive/audiocontrol/aidl/vts/Android.bp
@@ -25,7 +25,6 @@
name: "VtsAidlHalAudioControlTest",
defaults: [
"latest_android_media_audio_common_types_cpp_static",
- "latest_android_hardware_audio_common_cpp_static",
"VtsHalTargetTestDefaults",
"use_libaidlvintf_gtest_helper_static",
],
@@ -40,6 +39,7 @@
],
static_libs: [
"android.hardware.automotive.audiocontrol-V3-cpp",
+ "android.hardware.audio.common-V1-cpp",
"libgmock",
],
test_suites: [
diff --git a/automotive/can/1.0/default/libc++fs/src/filesystem/directory_iterator.cpp b/automotive/can/1.0/default/libc++fs/src/filesystem/directory_iterator.cpp
index 624538b..37c863b 100644
--- a/automotive/can/1.0/default/libc++fs/src/filesystem/directory_iterator.cpp
+++ b/automotive/can/1.0/default/libc++fs/src/filesystem/directory_iterator.cpp
@@ -169,8 +169,8 @@
__dir_stream& operator=(const __dir_stream&) = delete;
__dir_stream(__dir_stream&& other) noexcept : __stream_(other.__stream_),
- __root_(move(other.__root_)),
- __entry_(move(other.__entry_)) {
+ __root_(std::move(other.__root_)),
+ __entry_(std::move(other.__entry_)) {
other.__stream_ = nullptr;
}
@@ -252,7 +252,7 @@
error_code m_ec;
if (!__imp_->advance(m_ec)) {
- path root = move(__imp_->__root_);
+ path root = std::move(__imp_->__root_);
__imp_.reset();
if (m_ec)
err.report(m_ec, "at root \"%s\"", root);
@@ -286,7 +286,7 @@
__imp_ = make_shared<__shared_imp>();
__imp_->__options_ = opt;
- __imp_->__stack_.push(move(new_s));
+ __imp_->__stack_.push(std::move(new_s));
}
void recursive_directory_iterator::__pop(error_code* ec) {
@@ -340,7 +340,7 @@
}
if (m_ec) {
- path root = move(stack.top().__root_);
+ path root = std::move(stack.top().__root_);
__imp_.reset();
err.report(m_ec, "at root \"%s\"", root);
} else {
@@ -374,7 +374,7 @@
if (!skip_rec) {
__dir_stream new_it(curr_it.__entry_.path(), __imp_->__options_, m_ec);
if (new_it.good()) {
- __imp_->__stack_.push(move(new_it));
+ __imp_->__stack_.push(std::move(new_it));
return true;
}
}
@@ -385,7 +385,7 @@
if (ec)
ec->clear();
} else {
- path at_ent = move(curr_it.__entry_.__p_);
+ path at_ent = std::move(curr_it.__entry_.__p_);
__imp_.reset();
err.report(m_ec, "attempting recursion into \"%s\"", at_ent);
}
diff --git a/automotive/evs/OWNERS b/automotive/evs/OWNERS
index b973e91..15de48f 100644
--- a/automotive/evs/OWNERS
+++ b/automotive/evs/OWNERS
@@ -1,3 +1,2 @@
ankitarora@google.com
-changyeon@google.com
jwhpryor@google.com
diff --git a/automotive/remoteaccess/bind_to_device_socket_mutator/Android.bp b/automotive/remoteaccess/bind_to_device_socket_mutator/Android.bp
new file mode 100644
index 0000000..113b14e
--- /dev/null
+++ b/automotive/remoteaccess/bind_to_device_socket_mutator/Android.bp
@@ -0,0 +1,43 @@
+/*
+ * 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 {
+ default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+cc_defaults {
+ name: "BindToDeviceSocketMutatorDefaults",
+ static_libs: [
+ "android.hardware.automotive.can@libnetdevice",
+ "libnl++",
+ ],
+ shared_libs: [
+ "libbase",
+ "liblog",
+ "libgrpc++",
+ ],
+ cflags: [
+ "-Wno-unused-parameter",
+ ],
+}
+
+cc_library {
+ name: "BindToDeviceSocketMutatorLib",
+ vendor_available: true,
+ srcs: ["src/*"],
+ export_include_dirs: ["include"],
+ defaults: ["BindToDeviceSocketMutatorDefaults"],
+}
diff --git a/automotive/remoteaccess/bind_to_device_socket_mutator/include/BindToDeviceSocketMutator.h b/automotive/remoteaccess/bind_to_device_socket_mutator/include/BindToDeviceSocketMutator.h
new file mode 100644
index 0000000..bafcc65
--- /dev/null
+++ b/automotive/remoteaccess/bind_to_device_socket_mutator/include/BindToDeviceSocketMutator.h
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+#pragma once
+
+#include <grpc++/grpc++.h>
+#include <src/core/lib/iomgr/socket_mutator.h>
+#include <string>
+
+namespace android::hardware::automotive::remoteaccess {
+
+class BindToDeviceSocketMutator final : public grpc_socket_mutator {
+ public:
+ BindToDeviceSocketMutator(const std::string_view& interface_name);
+
+ bool mutateFd(int fd);
+
+ private:
+ std::string mIfname;
+};
+
+} // namespace android::hardware::automotive::remoteaccess
diff --git a/automotive/remoteaccess/bind_to_device_socket_mutator/src/BindToDeviceSocketMutator.cpp b/automotive/remoteaccess/bind_to_device_socket_mutator/src/BindToDeviceSocketMutator.cpp
new file mode 100644
index 0000000..c6a96de
--- /dev/null
+++ b/automotive/remoteaccess/bind_to_device_socket_mutator/src/BindToDeviceSocketMutator.cpp
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ */
+
+#include "BindToDeviceSocketMutator.h"
+
+#include <android-base/logging.h>
+#include <errno.h>
+#include <sys/socket.h>
+
+namespace android::hardware::automotive::remoteaccess {
+
+bool BindToDeviceSocketMutator::mutateFd(int fd) {
+ int ret = setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, mIfname.c_str(), mIfname.size());
+ if (ret != 0) {
+ PLOG(ERROR) << "Can't bind socket to interface " << mIfname;
+ return false;
+ }
+ return true;
+}
+
+bool bind_to_device_mutator_mutate_fd(int fd, grpc_socket_mutator* mutator) {
+ BindToDeviceSocketMutator* bsm = (BindToDeviceSocketMutator*)mutator;
+ return bsm->mutateFd(fd);
+}
+
+int bind_to_device_mutator_compare(grpc_socket_mutator* a, grpc_socket_mutator* b) {
+ return ((a) < (b) ? -1 : ((a) > (b) ? 1 : 0));
+}
+
+void bind_to_device_mutator_destroy(grpc_socket_mutator* mutator) {
+ BindToDeviceSocketMutator* bsm = (BindToDeviceSocketMutator*)mutator;
+ delete bsm;
+}
+
+grpc_socket_mutator_vtable bind_to_device_mutator_vtable = {bind_to_device_mutator_mutate_fd,
+ bind_to_device_mutator_compare,
+ bind_to_device_mutator_destroy};
+
+BindToDeviceSocketMutator::BindToDeviceSocketMutator(const std::string_view& interface_name) {
+ mIfname = interface_name;
+ grpc_socket_mutator_init(this, &bind_to_device_mutator_vtable);
+}
+
+} // namespace android::hardware::automotive::remoteaccess
diff --git a/automotive/remoteaccess/hal/default/Android.bp b/automotive/remoteaccess/hal/default/Android.bp
index f27b8f8..0155667 100644
--- a/automotive/remoteaccess/hal/default/Android.bp
+++ b/automotive/remoteaccess/hal/default/Android.bp
@@ -22,22 +22,27 @@
name: "remote-access-hal-defaults",
vendor: true,
relative_install_path: "hw",
- srcs: ["src/RemoteAccessImpl.cpp"],
+ srcs: [
+ "src/RemoteAccessImpl.cpp",
+ ],
whole_static_libs: [
"RemoteAccessService",
],
+ static_libs: [
+ "BindToDeviceSocketMutatorLib",
+ ],
shared_libs: [
- "libbase",
"libbinder_ndk",
- "liblog",
"libutils",
- "libgrpc++",
"libprotobuf-cpp-full",
],
defaults: [
"vhalclient_defaults",
+ "BindToDeviceSocketMutatorDefaults",
],
cflags: [
+ // This is already included in BindToDeviceSocketMutatorDefaults but
+ // might be overridden by vhalclient_defaults.
"-Wno-unused-parameter",
],
}
@@ -59,6 +64,7 @@
init_rc: ["remoteaccess-tcu-test-service.rc"],
cflags: [
"-DGRPC_SERVICE_ADDRESS=\"10.10.10.1:50051\"",
+ "-DGRPC_SERVICE_IFNAME=\"eth1\"",
],
}
diff --git a/automotive/remoteaccess/hal/default/src/RemoteAccessImpl.cpp b/automotive/remoteaccess/hal/default/src/RemoteAccessImpl.cpp
index 8720c2f..d525141 100644
--- a/automotive/remoteaccess/hal/default/src/RemoteAccessImpl.cpp
+++ b/automotive/remoteaccess/hal/default/src/RemoteAccessImpl.cpp
@@ -18,45 +18,60 @@
#include "RemoteAccessService.h"
+#include "BindToDeviceSocketMutator.h"
+
+#include <android-base/logging.h>
#include <android/binder_manager.h>
#include <android/binder_process.h>
#include <grpcpp/create_channel.h>
+#include <libnetdevice/libnetdevice.h>
#include <stdlib.h>
-#include <utils/Log.h>
constexpr char SERVICE_NAME[] = "android.hardware.automotive.remoteaccess.IRemoteAccess/default";
int main(int /* argc */, char* /* argv */[]) {
- ALOGI("Registering RemoteAccessService as service...");
+ LOG(INFO) << "Registering RemoteAccessService as service...";
#ifndef GRPC_SERVICE_ADDRESS
- ALOGE("GRPC_SERVICE_ADDRESS is not defined, exiting");
+ LOG(ERROR) << "GRPC_SERVICE_ADDRESS is not defined, exiting";
exit(1);
#endif
- auto channel = grpc::CreateChannel(GRPC_SERVICE_ADDRESS, grpc::InsecureChannelCredentials());
+ grpc::ChannelArguments grpcargs = {};
+
+#ifdef GRPC_SERVICE_IFNAME
+ grpcargs.SetSocketMutator(
+ new android::hardware::automotive::remoteaccess::BindToDeviceSocketMutator(
+ GRPC_SERVICE_IFNAME));
+ LOG(DEBUG) << "GRPC_SERVICE_IFNAME specified as: " << GRPC_SERVICE_IFNAME;
+ LOG(INFO) << "Waiting for interface: " << GRPC_SERVICE_IFNAME;
+ android::netdevice::waitFor({GRPC_SERVICE_IFNAME},
+ android::netdevice::WaitCondition::PRESENT_AND_UP);
+ LOG(INFO) << "Waiting for interface: " << GRPC_SERVICE_IFNAME << " done";
+#endif
+ auto channel = grpc::CreateCustomChannel(GRPC_SERVICE_ADDRESS,
+ grpc::InsecureChannelCredentials(), grpcargs);
auto clientStub = android::hardware::automotive::remoteaccess::WakeupClient::NewStub(channel);
auto service = ndk::SharedRefBase::make<
android::hardware::automotive::remoteaccess::RemoteAccessService>(clientStub.get());
binder_exception_t err = AServiceManager_addService(service->asBinder().get(), SERVICE_NAME);
if (err != EX_NONE) {
- ALOGE("failed to register android.hardware.automotive.remote.IRemoteAccess service, "
- "exception: %d",
- err);
+ LOG(ERROR) << "failed to register android.hardware.automotive.remote.IRemoteAccess service"
+ << ", exception: " << err;
exit(1);
}
if (!ABinderProcess_setThreadPoolMaxThreadCount(1)) {
- ALOGE("%s", "failed to set thread pool max thread count");
+ LOG(ERROR) << "failed to set thread pool max thread count";
exit(1);
}
ABinderProcess_startThreadPool();
- ALOGI("RemoteAccess service Ready");
+ LOG(INFO) << "RemoteAccess service Ready";
ABinderProcess_joinThreadPool();
- ALOGW("Should not reach here");
+ LOG(ERROR) << "Should not reach here";
return 0;
}
diff --git a/automotive/vehicle/2.0/types.hal b/automotive/vehicle/2.0/types.hal
index 83b0d94..00d0452 100644
--- a/automotive/vehicle/2.0/types.hal
+++ b/automotive/vehicle/2.0/types.hal
@@ -829,10 +829,10 @@
/*
* HVAC Properties
*
- * Additional rules for mapping a zoned HVAC property (except
- * HVAC_MAX_DEFROST_ON) to AreaIDs:
- * - Every seat in VehicleAreaSeat that is available in the car, must be
- * part of an AreaID in the AreaID array.
+ * Additional rules for mapping non-GLOBAL VehicleArea type HVAC properties
+ * to AreaIDs:
+ * - Every “area” for a specific VehicleArea type that is affected by the
+ * property, must be included in an area ID for that property.
*
* Example 1: A car has two front seats (ROW_1_LEFT, ROW_1_RIGHT) and three
* back seats (ROW_2_LEFT, ROW_2_CENTER, ROW_2_RIGHT). There are two
@@ -860,6 +860,16 @@
* - ROW_1_LEFT
* - ROW_1_RIGHT
* - ROW_2_LEFT | ROW_2_CENTER | ROW_2_RIGHT | ROW_3_LEFT | ROW_3_CENTER | ROW_3_RIGHT
+ *
+ * Example 3: A car has two front seats (ROW_1_LEFT, ROW_1_RIGHT) and three
+ * back seats (ROW_2_LEFT, ROW_2_CENTER, ROW_2_RIGHT). Suppose the car
+ * supports HVAC_AUTO_ON for just the two front seats.
+ * - A valid mapping set of AreaIDs for HVAC_AUTO_ON would be:
+ * - ROW_1_LEFT | ROW_1_RIGHT
+ * - If HVAC_AUTO_ON had two separate control units for the driver side
+ * and passenger side, an alternative mapping would be:
+ * - ROW_1_LEFT
+ * - ROW_1_RIGHT
*/
/**
diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h
index a3b79e8..c8a36b8 100644
--- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h
+++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h
@@ -191,6 +191,7 @@
{VehicleProperty::GLOVE_BOX_DOOR_POS, VehiclePropertyAccess::READ_WRITE},
{VehicleProperty::GLOVE_BOX_LOCKED, VehiclePropertyAccess::READ_WRITE},
{VehicleProperty::VEHICLE_MAP_SERVICE, VehiclePropertyAccess::READ_WRITE},
+ {VehicleProperty::LOCATION_CHARACTERIZATION, VehiclePropertyAccess::READ},
{VehicleProperty::OBD2_LIVE_FRAME, VehiclePropertyAccess::READ},
{VehicleProperty::OBD2_FREEZE_FRAME, VehiclePropertyAccess::READ},
{VehicleProperty::OBD2_FREEZE_FRAME_INFO, VehiclePropertyAccess::READ},
diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h
index 9d2cd7f..bea5002 100644
--- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h
+++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h
@@ -191,6 +191,7 @@
{VehicleProperty::GLOVE_BOX_DOOR_POS, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::GLOVE_BOX_LOCKED, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::VEHICLE_MAP_SERVICE, VehiclePropertyChangeMode::ON_CHANGE},
+ {VehicleProperty::LOCATION_CHARACTERIZATION, VehiclePropertyChangeMode::STATIC},
{VehicleProperty::OBD2_LIVE_FRAME, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::OBD2_FREEZE_FRAME, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::OBD2_FREEZE_FRAME_INFO, VehiclePropertyChangeMode::ON_CHANGE},
diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java
index 2f45a23..ee214ef 100644
--- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java
+++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java
@@ -183,6 +183,7 @@
Map.entry(VehicleProperty.GLOVE_BOX_DOOR_POS, VehiclePropertyAccess.READ_WRITE),
Map.entry(VehicleProperty.GLOVE_BOX_LOCKED, VehiclePropertyAccess.READ_WRITE),
Map.entry(VehicleProperty.VEHICLE_MAP_SERVICE, VehiclePropertyAccess.READ_WRITE),
+ Map.entry(VehicleProperty.LOCATION_CHARACTERIZATION, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.OBD2_LIVE_FRAME, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.OBD2_FREEZE_FRAME, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.OBD2_FREEZE_FRAME_INFO, VehiclePropertyAccess.READ),
diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java
index fef80d2..d3cf71e 100644
--- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java
+++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java
@@ -183,6 +183,7 @@
Map.entry(VehicleProperty.GLOVE_BOX_DOOR_POS, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.GLOVE_BOX_LOCKED, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.VEHICLE_MAP_SERVICE, VehiclePropertyChangeMode.ON_CHANGE),
+ Map.entry(VehicleProperty.LOCATION_CHARACTERIZATION, VehiclePropertyChangeMode.STATIC),
Map.entry(VehicleProperty.OBD2_LIVE_FRAME, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.OBD2_FREEZE_FRAME, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.OBD2_FREEZE_FRAME_INFO, VehiclePropertyChangeMode.ON_CHANGE),
diff --git a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp
index a651178..d921079 100644
--- a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp
+++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp
@@ -57,6 +57,7 @@
using ::aidl::android::hardware::automotive::vehicle::LaneCenteringAssistState;
using ::aidl::android::hardware::automotive::vehicle::LaneDepartureWarningState;
using ::aidl::android::hardware::automotive::vehicle::LaneKeepAssistState;
+using ::aidl::android::hardware::automotive::vehicle::LocationCharacterization;
using ::aidl::android::hardware::automotive::vehicle::RawPropValues;
using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReport;
using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReq;
@@ -200,6 +201,8 @@
std::make_unique<ConstantParser<VehiclePropertyAccess>>();
mConstantParsersByType["VehiclePropertyChangeMode"] =
std::make_unique<ConstantParser<VehiclePropertyChangeMode>>();
+ mConstantParsersByType["LocationCharacterization"] =
+ std::make_unique<ConstantParser<LocationCharacterization>>();
mConstantParsersByType["VehicleGear"] = std::make_unique<ConstantParser<VehicleGear>>();
mConstantParsersByType["VehicleAreaWindow"] =
std::make_unique<ConstantParser<VehicleAreaWindow>>();
diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json
index 8bcb1cc..5d15f32 100644
--- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json
+++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json
@@ -3130,6 +3130,14 @@
"property": "VehicleProperty::VEHICLE_MAP_SERVICE"
},
{
+ "property": "VehicleProperty::LOCATION_CHARACTERIZATION",
+ "defaultValue": {
+ "int32Values": [
+ "LocationCharacterization::RAW_GNSS_ONLY"
+ ]
+ }
+ },
+ {
"property": "VehicleProperty::ELECTRONIC_TOLL_COLLECTION_CARD_TYPE",
"defaultValue": {
"int32Values": [
diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp
index 00ebdda..7b4fa16 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp
+++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp
@@ -15,6 +15,7 @@
*/
#define LOG_TAG "FakeVehicleHardware"
+#define ATRACE_TAG ATRACE_TAG_HAL
#define FAKE_VEHICLEHARDWARE_DEBUG false // STOPSHIP if true.
#include "FakeVehicleHardware.h"
@@ -33,6 +34,7 @@
#include <android-base/strings.h>
#include <utils/Log.h>
#include <utils/SystemClock.h>
+#include <utils/Trace.h>
#include <dirent.h>
#include <inttypes.h>
@@ -1628,11 +1630,15 @@
std::unordered_map<std::shared_ptr<const GetValuesCallback>, std::vector<GetValueResult>>
callbackToResults;
for (const auto& rwc : mRequests.flush()) {
+ ATRACE_BEGIN("FakeVehicleHardware:handleGetValueRequest");
auto result = mHardware->handleGetValueRequest(rwc.request);
+ ATRACE_END();
callbackToResults[rwc.callback].push_back(std::move(result));
}
for (const auto& [callback, results] : callbackToResults) {
+ ATRACE_BEGIN("FakeVehicleHardware:call get value result callback");
(*callback)(std::move(results));
+ ATRACE_END();
}
}
@@ -1642,11 +1648,15 @@
std::unordered_map<std::shared_ptr<const SetValuesCallback>, std::vector<SetValueResult>>
callbackToResults;
for (const auto& rwc : mRequests.flush()) {
+ ATRACE_BEGIN("FakeVehicleHardware:handleSetValueRequest");
auto result = mHardware->handleSetValueRequest(rwc.request);
+ ATRACE_END();
callbackToResults[rwc.callback].push_back(std::move(result));
}
for (const auto& [callback, results] : callbackToResults) {
+ ATRACE_BEGIN("FakeVehicleHardware:call set value result callback");
(*callback)(std::move(results));
+ ATRACE_END();
}
}
diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h
index fc0c8db..7db4246 100644
--- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h
+++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h
@@ -44,6 +44,7 @@
#include <aidl/android/hardware/automotive/vehicle/LaneCenteringAssistState.h>
#include <aidl/android/hardware/automotive/vehicle/LaneDepartureWarningState.h>
#include <aidl/android/hardware/automotive/vehicle/LaneKeepAssistState.h>
+#include <aidl/android/hardware/automotive/vehicle/LocationCharacterization.h>
#include <aidl/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.h>
#include <aidl/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.h>
#include <aidl/android/hardware/automotive/vehicle/Obd2FuelType.h>
diff --git a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp
index 4a4e023..a7ac1b4 100644
--- a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp
+++ b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp
@@ -15,6 +15,7 @@
*/
#define LOG_TAG "DefaultVehicleHal"
+#define ATRACE_TAG ATRACE_TAG_HAL
#include <DefaultVehicleHal.h>
@@ -28,6 +29,7 @@
#include <private/android_filesystem_config.h>
#include <utils/Log.h>
#include <utils/SystemClock.h>
+#include <utils/Trace.h>
#include <inttypes.h>
#include <set>
@@ -350,6 +352,7 @@
ScopedAStatus DefaultVehicleHal::getValues(const CallbackType& callback,
const GetValueRequests& requests) {
+ ATRACE_CALL();
if (callback == nullptr) {
return ScopedAStatus::fromExceptionCode(EX_NULL_POINTER);
}
@@ -436,6 +439,7 @@
ScopedAStatus DefaultVehicleHal::setValues(const CallbackType& callback,
const SetValueRequests& requests) {
+ ATRACE_CALL();
if (callback == nullptr) {
return ScopedAStatus::fromExceptionCode(EX_NULL_POINTER);
}
diff --git a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp
index 36fa5e6..05e569a 100644
--- a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp
+++ b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp
@@ -671,8 +671,8 @@
}
TEST_F(DefaultVehicleHalTest, testGetValuesFinishBeforeTimeout) {
- // timeout: 0.1s
- int64_t timeout = 100000000;
+ // timeout: 1s
+ int64_t timeout = 1000000000;
setTimeout(timeout);
GetValueRequests requests;
@@ -681,17 +681,15 @@
ASSERT_TRUE(getValuesTestCases(10, requests, expectedResults, expectedHardwareRequests).ok());
- // The response would be returned after 0.05s.
- getHardware()->setSleepTime(timeout / 2);
+ // The response would be returned after 0.01s.
+ getHardware()->setSleepTime(timeout / 100);
getHardware()->addGetValueResponses(expectedResults);
auto status = getClient()->getValues(getCallbackClient(), requests);
ASSERT_TRUE(status.isOk()) << "getValues failed: " << status.getMessage();
- // Wait for the response.
- std::this_thread::sleep_for(std::chrono::nanoseconds(timeout));
-
+ ASSERT_TRUE(getCallback()->waitForGetValueResults(1, timeout)) << "no results in callback";
auto maybeGetValueResults = getCallback()->nextGetValueResults();
ASSERT_TRUE(maybeGetValueResults.has_value()) << "no results in callback";
EXPECT_EQ(maybeGetValueResults.value().payloads, expectedResults) << "results mismatch";
@@ -699,8 +697,8 @@
}
TEST_F(DefaultVehicleHalTest, testGetValuesFinishAfterTimeout) {
- // timeout: 0.1s
- int64_t timeout = 100000000;
+ // timeout: 0.01s
+ int64_t timeout = 10000000;
setTimeout(timeout);
GetValueRequests requests;
@@ -709,17 +707,14 @@
ASSERT_TRUE(getValuesTestCases(10, requests, expectedResults, expectedHardwareRequests).ok());
- // The response would be returned after 0.2s.
- getHardware()->setSleepTime(timeout * 2);
+ // The response would be returned after 0.1s.
+ getHardware()->setSleepTime(timeout * 10);
getHardware()->addGetValueResponses(expectedResults);
auto status = getClient()->getValues(getCallbackClient(), requests);
ASSERT_TRUE(status.isOk()) << "getValues failed: " << status.getMessage();
- // Wait for the response.
- std::this_thread::sleep_for(std::chrono::nanoseconds(timeout * 5));
-
for (size_t i = 0; i < expectedResults.size(); i++) {
expectedResults[i] = {
.requestId = expectedResults[i].requestId,
@@ -728,6 +723,8 @@
};
}
+ ASSERT_TRUE(getCallback()->waitForGetValueResults(1, timeout * 100))
+ << "no results in callback";
auto maybeGetValueResults = getCallback()->nextGetValueResults();
ASSERT_TRUE(maybeGetValueResults.has_value()) << "no results in callback";
ASSERT_THAT(maybeGetValueResults.value().payloads, UnorderedElementsAreArray(expectedResults))
@@ -960,8 +957,8 @@
}
TEST_F(DefaultVehicleHalTest, testSetValuesFinishBeforeTimeout) {
- // timeout: 0.1s
- int64_t timeout = 100000000;
+ // timeout: 1s
+ int64_t timeout = 1000000000;
setTimeout(timeout);
SetValueRequests requests;
@@ -970,17 +967,15 @@
ASSERT_TRUE(setValuesTestCases(10, requests, expectedResults, expectedHardwareRequests).ok());
- // The response would be returned after 0.05s.
- getHardware()->setSleepTime(timeout / 2);
+ // The response would be returned after 0.01s.
+ getHardware()->setSleepTime(timeout / 100);
getHardware()->addSetValueResponses(expectedResults);
auto status = getClient()->setValues(getCallbackClient(), requests);
ASSERT_TRUE(status.isOk()) << "setValues failed: " << status.getMessage();
- // Wait for the response.
- std::this_thread::sleep_for(std::chrono::nanoseconds(timeout));
-
+ ASSERT_TRUE(getCallback()->waitForSetValueResults(1, timeout)) << "no set value results";
auto maybeSetValueResults = getCallback()->nextSetValueResults();
ASSERT_TRUE(maybeSetValueResults.has_value()) << "no results in callback";
EXPECT_EQ(maybeSetValueResults.value().payloads, expectedResults) << "results mismatch";
@@ -988,8 +983,8 @@
}
TEST_F(DefaultVehicleHalTest, testSetValuesFinishAfterTimeout) {
- // timeout: 0.1s
- int64_t timeout = 100000000;
+ // timeout: 0.01s
+ int64_t timeout = 10000000;
setTimeout(timeout);
SetValueRequests requests;
@@ -998,17 +993,14 @@
ASSERT_TRUE(setValuesTestCases(10, requests, expectedResults, expectedHardwareRequests).ok());
- // The response would be returned after 0.2s.
- getHardware()->setSleepTime(timeout * 2);
+ // The response would be returned after 0.1s.
+ getHardware()->setSleepTime(timeout * 10);
getHardware()->addSetValueResponses(expectedResults);
auto status = getClient()->setValues(getCallbackClient(), requests);
ASSERT_TRUE(status.isOk()) << "setValues failed: " << status.getMessage();
- // Wait for the response.
- std::this_thread::sleep_for(std::chrono::nanoseconds(timeout * 5));
-
for (size_t i = 0; i < expectedResults.size(); i++) {
expectedResults[i] = {
.requestId = expectedResults[i].requestId,
@@ -1016,6 +1008,7 @@
};
}
+ ASSERT_TRUE(getCallback()->waitForSetValueResults(1, timeout * 100)) << "no set value results";
auto maybeSetValueResults = getCallback()->nextSetValueResults();
ASSERT_TRUE(maybeSetValueResults.has_value()) << "no results in callback";
ASSERT_THAT(maybeSetValueResults.value().payloads, UnorderedElementsAreArray(expectedResults))
@@ -1456,7 +1449,7 @@
std::vector<SubscribeOptions> options = {
{
.propId = GLOBAL_CONTINUOUS_PROP,
- .sampleRate = 20.0,
+ .sampleRate = 100.0,
},
};
@@ -1469,16 +1462,20 @@
ASSERT_TRUE(status.isOk()) << "unsubscribe failed: " << status.getMessage();
+ // Wait for the last events to come.
+ std::this_thread::sleep_for(std::chrono::milliseconds(100));
+
// Clear existing events.
while (getCallback()->nextOnPropertyEventResults().has_value()) {
// Do nothing.
}
- // Wait for a while, make sure no new events are generated.
+ // Wait for a while, make sure no new events are generated. If still subscribed, this should
+ // generate around 10 events.
std::this_thread::sleep_for(std::chrono::milliseconds(100));
- ASSERT_FALSE(getCallback()->nextOnPropertyEventResults().has_value())
- << "No property event should be generated after unsubscription";
+ ASSERT_EQ(getCallback()->countOnPropertyEventResults(), 0u)
+ << "Property event generation must stop after unsubscription";
}
class SubscribeInvalidOptionsTest
diff --git a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.cpp b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.cpp
index 0e46357..f51ce5c 100644
--- a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.cpp
+++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.cpp
@@ -16,6 +16,9 @@
#include "MockVehicleCallback.h"
+#include <android-base/thread_annotations.h>
+#include <chrono>
+
namespace android {
namespace hardware {
namespace automotive {
@@ -27,6 +30,7 @@
using ::aidl::android::hardware::automotive::vehicle::SetValueResults;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropErrors;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropValues;
+using ::android::base::ScopedLockAssertion;
using ::ndk::ScopedAStatus;
using ::ndk::ScopedFileDescriptor;
@@ -46,21 +50,35 @@
} // namespace
ScopedAStatus MockVehicleCallback::onGetValues(const GetValueResults& results) {
- std::scoped_lock<std::mutex> lockGuard(mLock);
- return storeResults(results, &mGetValueResults);
+ ScopedAStatus result;
+ {
+ std::scoped_lock<std::mutex> lockGuard(mLock);
+ result = storeResults(results, &mGetValueResults);
+ }
+ mCond.notify_all();
+ return result;
}
ScopedAStatus MockVehicleCallback::onSetValues(const SetValueResults& results) {
- std::scoped_lock<std::mutex> lockGuard(mLock);
- return storeResults(results, &mSetValueResults);
+ ScopedAStatus result;
+ {
+ std::scoped_lock<std::mutex> lockGuard(mLock);
+ result = storeResults(results, &mSetValueResults);
+ }
+ mCond.notify_all();
+ return result;
}
ScopedAStatus MockVehicleCallback::onPropertyEvent(const VehiclePropValues& results,
int32_t sharedMemoryFileCount) {
- std::scoped_lock<std::mutex> lockGuard(mLock);
-
- mSharedMemoryFileCount = sharedMemoryFileCount;
- return storeResults(results, &mOnPropertyEventResults);
+ ScopedAStatus result;
+ {
+ std::scoped_lock<std::mutex> lockGuard(mLock);
+ mSharedMemoryFileCount = sharedMemoryFileCount;
+ result = storeResults(results, &mOnPropertyEventResults);
+ }
+ mCond.notify_all();
+ return result;
}
ScopedAStatus MockVehicleCallback::onPropertySetError(const VehiclePropErrors&) {
@@ -87,6 +105,22 @@
return mOnPropertyEventResults.size();
}
+bool MockVehicleCallback::waitForSetValueResults(size_t size, size_t timeoutInNano) {
+ std::unique_lock lk(mLock);
+ return mCond.wait_for(lk, std::chrono::nanoseconds(timeoutInNano), [this, size] {
+ ScopedLockAssertion lockAssertion(mLock);
+ return mSetValueResults.size() >= size;
+ });
+}
+
+bool MockVehicleCallback::waitForGetValueResults(size_t size, size_t timeoutInNano) {
+ std::unique_lock lk(mLock);
+ return mCond.wait_for(lk, std::chrono::nanoseconds(timeoutInNano), [this, size] {
+ ScopedLockAssertion lockAssertion(mLock);
+ return mGetValueResults.size() >= size;
+ });
+}
+
} // namespace vehicle
} // namespace automotive
} // namespace hardware
diff --git a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.h b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.h
index 0faaa1f..f17b273 100644
--- a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.h
+++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.h
@@ -22,6 +22,7 @@
#include <aidl/android/hardware/automotive/vehicle/BnVehicleCallback.h>
#include <android-base/thread_annotations.h>
+#include <condition_variable>
#include <list>
#include <mutex>
#include <optional>
@@ -63,9 +64,12 @@
std::optional<aidl::android::hardware::automotive::vehicle::VehiclePropValues>
nextOnPropertyEventResults();
size_t countOnPropertyEventResults();
+ bool waitForSetValueResults(size_t size, size_t timeoutInNano);
+ bool waitForGetValueResults(size_t size, size_t timeoutInNano);
private:
std::mutex mLock;
+ std::condition_variable mCond;
std::list<aidl::android::hardware::automotive::vehicle::GetValueResults> mGetValueResults
GUARDED_BY(mLock);
std::list<aidl::android::hardware::automotive::vehicle::SetValueResults> mSetValueResults
diff --git a/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp
index eb3c663..cb8c8d1 100644
--- a/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp
+++ b/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp
@@ -231,7 +231,7 @@
std::vector<SubscribeOptions> options = {{
.propId = 0,
.areaIds = {0},
- .sampleRate = 10.0,
+ .sampleRate = 100.0,
}};
auto result = getManager()->subscribe(getCallbackClient(), options, true);
@@ -240,11 +240,13 @@
result = getManager()->unsubscribe(getCallbackClient()->asBinder().get());
ASSERT_TRUE(result.ok()) << "failed to unsubscribe: " << result.error().message();
+ // Wait for the last events to come.
+ std::this_thread::sleep_for(std::chrono::milliseconds(100));
+
clearEvents();
- std::this_thread::sleep_for(std::chrono::milliseconds(200));
+ std::this_thread::sleep_for(std::chrono::milliseconds(100));
- // Theoretically trigger 10 times, but check for at least 9 times to be stable.
ASSERT_TRUE(getEvents().empty());
}
@@ -269,6 +271,9 @@
std::vector<int32_t>({0}));
ASSERT_TRUE(result.ok()) << "failed to unsubscribe: " << result.error().message();
+ // Wait for the last events to come.
+ std::this_thread::sleep_for(std::chrono::milliseconds(100));
+
clearEvents();
std::this_thread::sleep_for(std::chrono::seconds(1));
@@ -301,6 +306,9 @@
result = getManager()->unsubscribe(getCallbackClient()->asBinder().get());
ASSERT_TRUE(result.ok()) << "failed to unsubscribe: " << result.error().message();
+ // Wait for the last events to come.
+ std::this_thread::sleep_for(std::chrono::milliseconds(100));
+
clearEvents();
std::this_thread::sleep_for(std::chrono::seconds(1));
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiRadioCombinationMatrix.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LocationCharacterization.aidl
similarity index 79%
copy from wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiRadioCombinationMatrix.aidl
copy to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LocationCharacterization.aidl
index ea86c4f..27abe41 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiRadioCombinationMatrix.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LocationCharacterization.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2022 The Android Open Source Project
+ * 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.
@@ -31,8 +31,16 @@
// 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.wifi;
-@VintfStability
-parcelable WifiRadioCombinationMatrix {
- android.hardware.wifi.WifiRadioCombination[] radioCombinations;
+package android.hardware.automotive.vehicle;
+@Backing(type="int") @VintfStability
+enum LocationCharacterization {
+ PRIOR_LOCATIONS = 0x1,
+ GYROSCOPE_FUSION = 0x2,
+ ACCELEROMETER_FUSION = 0x4,
+ COMPASS_FUSION = 0x8,
+ WHEEL_SPEED_FUSION = 0x10,
+ STEERING_ANGLE_FUSION = 0x20,
+ CAR_SPEED_FUSION = 0x40,
+ DEAD_RECKONED = 0x80,
+ RAW_GNSS_ONLY = 0x100,
}
diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleProperty.aidl
index 175b0ac..e0267f3 100644
--- a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleProperty.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleProperty.aidl
@@ -189,6 +189,7 @@
GLOVE_BOX_DOOR_POS = (((0x0BF0 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518896 */,
GLOVE_BOX_LOCKED = (((0x0BF1 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 354421745 */,
VEHICLE_MAP_SERVICE = (((0x0C00 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299895808 */,
+ LOCATION_CHARACTERIZATION = (((0x0C10 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289410064 */,
OBD2_LIVE_FRAME = (((0x0D00 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896064 */,
OBD2_FREEZE_FRAME = (((0x0D01 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896065 */,
OBD2_FREEZE_FRAME_INFO = (((0x0D02 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896066 */,
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LocationCharacterization.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LocationCharacterization.aidl
new file mode 100644
index 0000000..e06df40
--- /dev/null
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LocationCharacterization.aidl
@@ -0,0 +1,73 @@
+/*
+ * 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.automotive.vehicle;
+
+/**
+ * Used by LOCATION_CHARACTERIZATION to enumerate the supported bit flags.
+ *
+ * These flags are used to indicate to what transformations are performed on the
+ * GNSS data before the location data is sent, so that location processing
+ * algorithms can take into account prior fusion.
+ *
+ * This enum can be extended in future releases to include additional bit flags.
+ */
+@VintfStability
+@Backing(type="int")
+enum LocationCharacterization {
+ /**
+ * Prior location samples have been used to refine the raw GNSS data (e.g. a
+ * Kalman Filter).
+ */
+ PRIOR_LOCATIONS = 0x1,
+ /**
+ * Gyroscope data has been used to refine the raw GNSS data.
+ */
+ GYROSCOPE_FUSION = 0x2,
+ /**
+ * Accelerometer data has been used to refine the raw GNSS data.
+ */
+ ACCELEROMETER_FUSION = 0x4,
+ /**
+ * Compass data has been used to refine the raw GNSS data.
+ */
+ COMPASS_FUSION = 0x8,
+ /**
+ * Wheel speed has been used to refine the raw GNSS data.
+ */
+ WHEEL_SPEED_FUSION = 0x10,
+ /**
+ * Steering angle has been used to refine the raw GNSS data.
+ */
+ STEERING_ANGLE_FUSION = 0x20,
+ /**
+ * Car speed has been used to refine the raw GNSS data.
+ */
+ CAR_SPEED_FUSION = 0x40,
+ /**
+ * Some effort is made to dead-reckon location. In particular, this means that
+ * relative changes in location have meaning when no GNSS satellite is
+ * available.
+ */
+ DEAD_RECKONED = 0x80,
+ /**
+ * Location is based on GNSS satellite signals without sufficient fusion of
+ * other sensors for complete dead reckoning. This flag should be set when
+ * relative changes to location cannot be relied on when no GNSS satellite is
+ * available.
+ */
+ RAW_GNSS_ONLY = 0x100,
+}
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl
index 235ccd0..4d7bb79 100644
--- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl
@@ -619,10 +619,10 @@
/**
* HVAC Properties
*
- * Additional rules for mapping a zoned HVAC property (except
- * HVAC_MAX_DEFROST_ON) to AreaIDs:
- * - Every seat in VehicleAreaSeat that is available in the car, must be
- * part of an AreaID in the AreaID array.
+ * Additional rules for mapping non-GLOBAL VehicleArea type HVAC properties
+ * to AreaIDs:
+ * - Every “area” for a specific VehicleArea type that is affected by the
+ * property, must be included in an area ID for that property.
*
* Example 1: A car has two front seats (ROW_1_LEFT, ROW_1_RIGHT) and three
* back seats (ROW_2_LEFT, ROW_2_CENTER, ROW_2_RIGHT). There are two
@@ -651,6 +651,16 @@
* - ROW_1_RIGHT
* - ROW_2_LEFT | ROW_2_CENTER | ROW_2_RIGHT | ROW_3_LEFT | ROW_3_CENTER | ROW_3_RIGHT
*
+ * Example 3: A car has two front seats (ROW_1_LEFT, ROW_1_RIGHT) and three
+ * back seats (ROW_2_LEFT, ROW_2_CENTER, ROW_2_RIGHT). Suppose the car
+ * supports HVAC_AUTO_ON for just the two front seats.
+ * - A valid mapping set of AreaIDs for HVAC_AUTO_ON would be:
+ * - ROW_1_LEFT | ROW_1_RIGHT
+ * - If HVAC_AUTO_ON had two separate control units for the driver side
+ * and passenger side, an alternative mapping would be:
+ * - ROW_1_LEFT
+ * - ROW_1_RIGHT
+ *
*
* Fan speed setting
*
@@ -2136,6 +2146,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
+ * @unit VehicleUnit:MILLI_SECS
*/
WINDSHIELD_WIPERS_PERIOD =
0x0BC5 + VehiclePropertyGroup.SYSTEM + VehicleArea.WINDOW + VehiclePropertyType.INT32,
@@ -2348,6 +2359,20 @@
VEHICLE_MAP_SERVICE = 0x0C00 + 0x10000000 + 0x01000000
+ 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED
/**
+ * Characterization of inputs used for computing location.
+ *
+ * This property must indicate what (if any) data and sensor inputs are considered by the system
+ * when computing the vehicle's location that is shared with Android through the GNSS HAL.
+ *
+ * The value must return a collection of bit flags. The bit flags are defined in
+ * LocationCharacterization.
+ *
+ * @change_mode VehiclePropertyChangeMode.STATIC
+ * @access VehiclePropertyAccess.READ
+ */
+ LOCATION_CHARACTERIZATION =
+ 0x0C10 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
+ /**
* OBD2 Live Sensor Data
*
* Reports a snapshot of the current (live) values of the OBD2 sensors available.
diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
index 1c9d0db..2da8179 100644
--- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
+++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
@@ -498,6 +498,12 @@
actualPropertyType);
}
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLocationCharacterizationConfig) {
+ verifyProperty(VehicleProperty::LOCATION_CHARACTERIZATION, VehiclePropertyAccess::READ,
+ VehiclePropertyChangeMode::STATIC, VehiclePropertyGroup::SYSTEM,
+ VehicleArea::GLOBAL, VehiclePropertyType::INT32);
+}
+
TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEmergencyLaneKeepAssistEnabledConfig) {
verifyProperty(VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_ENABLED,
VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl
index 89f76f4..7075f71 100644
--- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl
+++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl
@@ -49,4 +49,5 @@
IMMOBILE,
RETRYING_CAPTURE,
LIFT_TOO_SOON,
+ POWER_PRESS,
}
diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/Error.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/Error.aidl
index d3592a1..9eeaac5 100644
--- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/Error.aidl
+++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/Error.aidl
@@ -44,4 +44,5 @@
UNABLE_TO_REMOVE,
VENDOR,
BAD_CALIBRATION,
+ POWER_PRESS,
}
diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl
index 2cdc196..41b7c5e 100644
--- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl
+++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl
@@ -103,4 +103,10 @@
* Fingerprint was lifted before the capture completed.
*/
LIFT_TOO_SOON,
+
+ /**
+ * Indicates a power press event has occurred. This is typically sent by fingerprint
+ * sensors that have the sensor co-located with the power button.
+ */
+ POWER_PRESS,
}
diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/Error.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/Error.aidl
index d8d47fa..39a5676 100644
--- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/Error.aidl
+++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/Error.aidl
@@ -70,4 +70,10 @@
* There's a problem with the sensor's calibration.
*/
BAD_CALIBRATION,
+
+ /**
+ * Indicates a power press event has occurred. This is typically sent by fingerprint
+ * sensors that have the sensor co-located with the power button.
+ */
+ POWER_PRESS,
}
diff --git a/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp b/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp
index 8ea1ddd..9451087 100644
--- a/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp
+++ b/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp
@@ -516,12 +516,15 @@
// Return the number of completed packets reported by the controller.
int BluetoothHidlTest::wait_for_completed_packets_event(uint16_t handle) {
int packets_processed = 0;
- wait_for_event(false);
- if (event_queue.size() == 0) {
- ALOGW("%s: WaitForCallback timed out.", __func__);
- return packets_processed;
- }
- while (event_queue.size() > 0) {
+ while (true) {
+ // There should be at least one event.
+ wait_for_event(packets_processed == 0);
+ if (event_queue.empty()) {
+ if (packets_processed == 0) {
+ ALOGW("%s: WaitForCallback timed out.", __func__);
+ }
+ return packets_processed;
+ }
hidl_vec<uint8_t> event = event_queue.front();
event_queue.pop();
diff --git a/bluetooth/1.1/vts/functional/VtsHalBluetoothV1_1TargetTest.cpp b/bluetooth/1.1/vts/functional/VtsHalBluetoothV1_1TargetTest.cpp
index 9ae3837..28ac603 100644
--- a/bluetooth/1.1/vts/functional/VtsHalBluetoothV1_1TargetTest.cpp
+++ b/bluetooth/1.1/vts/functional/VtsHalBluetoothV1_1TargetTest.cpp
@@ -539,12 +539,15 @@
// Return the number of completed packets reported by the controller.
int BluetoothHidlTest::wait_for_completed_packets_event(uint16_t handle) {
int packets_processed = 0;
- wait_for_event(false);
- if (event_queue.size() == 0) {
- ALOGW("%s: WaitForCallback timed out.", __func__);
- return packets_processed;
- }
- while (event_queue.size() > 0) {
+ while (true) {
+ // There should be at least one event.
+ wait_for_event(packets_processed == 0);
+ if (event_queue.empty()) {
+ if (packets_processed == 0) {
+ ALOGW("%s: WaitForCallback timed out.", __func__);
+ }
+ return packets_processed;
+ }
hidl_vec<uint8_t> event = event_queue.front();
event_queue.pop();
diff --git a/cas/aidl/android/hardware/cas/DestinationBuffer.aidl b/cas/aidl/android/hardware/cas/DestinationBuffer.aidl
index 74336c2..ac562dc 100644
--- a/cas/aidl/android/hardware/cas/DestinationBuffer.aidl
+++ b/cas/aidl/android/hardware/cas/DestinationBuffer.aidl
@@ -25,13 +25,13 @@
@VintfStability
union DestinationBuffer {
/**
- * If type == SHARED_MEMORY, the descrambled data must be written
+ * If the buffer is SharedBuffer, the descrambled data must be written
* to user-space non-secure shared memory.
*/
SharedBuffer nonsecureMemory;
/**
- * If type == NATIVE_HANDLE, the descrambled data must be written
+ * If the buffer is presented by NativeHandle, the descrambled data must be written
* to secure memory referenced by the vendor's buffer allocator.
*/
NativeHandle secureMemory;
diff --git a/confirmationui/1.0/default/OWNERS b/confirmationui/1.0/default/OWNERS
index 335660d..17aed51 100644
--- a/confirmationui/1.0/default/OWNERS
+++ b/confirmationui/1.0/default/OWNERS
@@ -1,2 +1,3 @@
+# Bug component: 1124672
jdanis@google.com
swillden@google.com
diff --git a/confirmationui/1.0/vts/OWNERS b/confirmationui/1.0/vts/OWNERS
index e7aa8b4..aa07242 100644
--- a/confirmationui/1.0/vts/OWNERS
+++ b/confirmationui/1.0/vts/OWNERS
@@ -1,3 +1,4 @@
+# Bug component: 1124672
jdanis@google.com
swillden@google.com
yim@google.com
diff --git a/confirmationui/OWNERS b/confirmationui/OWNERS
index 2bcdb0e..d3896df 100644
--- a/confirmationui/OWNERS
+++ b/confirmationui/OWNERS
@@ -1,2 +1,3 @@
+# Bug component: 1124672
swillden@google.com
subrahmanyaman@google.com
diff --git a/confirmationui/aidl/vts/functional/Android.bp b/confirmationui/aidl/vts/functional/Android.bp
index 3649c87..ac2d53a 100644
--- a/confirmationui/aidl/vts/functional/Android.bp
+++ b/confirmationui/aidl/vts/functional/Android.bp
@@ -23,7 +23,7 @@
name: "VtsHalConfirmationUITargetTest",
defaults: [
"VtsHalTargetTestDefaults",
- "keymint_use_latest_hal_aidl_ndk_shared",
+ "keymint_use_latest_hal_aidl_ndk_static",
"use_libaidlvintf_gtest_helper_static",
],
srcs: [
@@ -31,8 +31,9 @@
],
static_libs: [
"android.hardware.confirmationui-V1-ndk",
- "libcn-cbor",
"android.hardware.confirmationui-support-lib",
+ "android.hardware.security.secureclock-V1-ndk",
+ "libcn-cbor",
],
shared_libs: [
"libbinder_ndk",
diff --git a/confirmationui/support/OWNERS b/confirmationui/support/OWNERS
index 335660d..17aed51 100644
--- a/confirmationui/support/OWNERS
+++ b/confirmationui/support/OWNERS
@@ -1,2 +1,3 @@
+# Bug component: 1124672
jdanis@google.com
swillden@google.com
diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHub.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHub.aidl
index d66e1ac..9f2eb76 100644
--- a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHub.aidl
+++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHub.aidl
@@ -46,7 +46,7 @@
void onHostEndpointConnected(in android.hardware.contexthub.HostEndpointInfo hostEndpointInfo);
void onHostEndpointDisconnected(char hostEndpointId);
long[] getPreloadedNanoappIds();
- void onNanSessionStateChanged(in boolean state);
+ void onNanSessionStateChanged(in android.hardware.contexthub.NanSessionStateUpdate update);
void setTestMode(in boolean enable);
- const int EX_CONTEXT_HUB_UNSPECIFIED = (-1);
+ const int EX_CONTEXT_HUB_UNSPECIFIED = (-1) /* -1 */;
}
diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHubCallback.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHubCallback.aidl
index e72ae73..6163cfc 100644
--- a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHubCallback.aidl
+++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHubCallback.aidl
@@ -38,6 +38,6 @@
void handleContextHubMessage(in android.hardware.contexthub.ContextHubMessage msg, in String[] msgContentPerms);
void handleContextHubAsyncEvent(in android.hardware.contexthub.AsyncEventType evt);
void handleTransactionResult(in int transactionId, in boolean success);
- void handleNanSessionRequest(in boolean enable);
+ void handleNanSessionRequest(in android.hardware.contexthub.NanSessionRequest request);
const int CONTEXTHUB_NAN_TRANSACTION_TIMEOUT_MS = 10000;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiRadioCombinationMatrix.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanSessionRequest.aidl
similarity index 88%
rename from wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiRadioCombinationMatrix.aidl
rename to contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanSessionRequest.aidl
index ea86c4f..d539707 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiRadioCombinationMatrix.aidl
+++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanSessionRequest.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2022 The Android Open Source Project
+ * 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.
@@ -31,8 +31,8 @@
// 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.wifi;
+package android.hardware.contexthub;
@VintfStability
-parcelable WifiRadioCombinationMatrix {
- android.hardware.wifi.WifiRadioCombination[] radioCombinations;
+parcelable NanSessionRequest {
+ boolean enable;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiRadioCombinationMatrix.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanSessionStateUpdate.aidl
similarity index 88%
copy from wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiRadioCombinationMatrix.aidl
copy to contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanSessionStateUpdate.aidl
index ea86c4f..80771e2 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiRadioCombinationMatrix.aidl
+++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanSessionStateUpdate.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2022 The Android Open Source Project
+ * 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.
@@ -31,8 +31,8 @@
// 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.wifi;
+package android.hardware.contexthub;
@VintfStability
-parcelable WifiRadioCombinationMatrix {
- android.hardware.wifi.WifiRadioCombination[] radioCombinations;
+parcelable NanSessionStateUpdate {
+ boolean state;
}
diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappBinary.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappBinary.aidl
index 741a9cf..fdf3860 100644
--- a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappBinary.aidl
+++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappBinary.aidl
@@ -40,7 +40,7 @@
byte targetChreApiMajorVersion;
byte targetChreApiMinorVersion;
byte[] customBinary;
- const int FLAG_SIGNED = (1 << 0);
- const int FLAG_ENCRYPTED = (1 << 1);
- const int FLAG_TCM_CAPABLE = (1 << 2);
+ const int FLAG_SIGNED = (1 << 0) /* 1 */;
+ const int FLAG_ENCRYPTED = (1 << 1) /* 2 */;
+ const int FLAG_TCM_CAPABLE = (1 << 2) /* 4 */;
}
diff --git a/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl b/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl
index f9838bd..17bffd6 100644
--- a/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl
+++ b/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl
@@ -20,6 +20,7 @@
import android.hardware.contexthub.ContextHubMessage;
import android.hardware.contexthub.HostEndpointInfo;
import android.hardware.contexthub.IContextHubCallback;
+import android.hardware.contexthub.NanSessionStateUpdate;
import android.hardware.contexthub.NanoappBinary;
import android.hardware.contexthub.NanoappInfo;
import android.hardware.contexthub.Setting;
@@ -212,9 +213,9 @@
* explicitly invoke handleNanSessionRequest() at a later point in time to attempt to
* re-enable NAN.
*
- * @param state True if the NAN session is currently enabled.
+ * @param update Information about the latest NAN session state.
*/
- void onNanSessionStateChanged(in boolean state);
+ void onNanSessionStateChanged(in NanSessionStateUpdate update);
/**
* Puts the context hub in and out of test mode. Test mode is a clean state
diff --git a/contexthub/aidl/android/hardware/contexthub/IContextHubCallback.aidl b/contexthub/aidl/android/hardware/contexthub/IContextHubCallback.aidl
index cff1893..bfcb51e 100644
--- a/contexthub/aidl/android/hardware/contexthub/IContextHubCallback.aidl
+++ b/contexthub/aidl/android/hardware/contexthub/IContextHubCallback.aidl
@@ -18,6 +18,7 @@
import android.hardware.contexthub.AsyncEventType;
import android.hardware.contexthub.ContextHubMessage;
+import android.hardware.contexthub.NanSessionRequest;
import android.hardware.contexthub.NanoappInfo;
@VintfStability
@@ -85,10 +86,9 @@
* request times out, onNanSessionStateChanged() will be invoked with the state that the session
* was previously in.
*
- * @param enable Whether the NAN session should be enabled or disabled depending on whether the
- * Contexthub needs access to NAN.
+ * @param request Request from the HAL indicating the latest NAN session state it would like.
*/
- void handleNanSessionRequest(in boolean enable);
+ void handleNanSessionRequest(in NanSessionRequest request);
/**
* Amount of time, in milliseconds, that a handleNanSessionRequest can be pending before the
diff --git a/contexthub/aidl/android/hardware/contexthub/NanSessionRequest.aidl b/contexthub/aidl/android/hardware/contexthub/NanSessionRequest.aidl
new file mode 100644
index 0000000..c462ba1
--- /dev/null
+++ b/contexthub/aidl/android/hardware/contexthub/NanSessionRequest.aidl
@@ -0,0 +1,29 @@
+/*
+ * 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.contexthub;
+
+/**
+ * Contains information needed to request a state change for a NAN session.
+ */
+@VintfStability
+parcelable NanSessionRequest {
+ /**
+ * Whether the NAN session should be enabled or disabled depending on whether the Contexthub
+ * needs access to NAN.
+ */
+ boolean enable;
+}
diff --git a/contexthub/aidl/android/hardware/contexthub/NanSessionStateUpdate.aidl b/contexthub/aidl/android/hardware/contexthub/NanSessionStateUpdate.aidl
new file mode 100644
index 0000000..a58eda5
--- /dev/null
+++ b/contexthub/aidl/android/hardware/contexthub/NanSessionStateUpdate.aidl
@@ -0,0 +1,28 @@
+/*
+ * 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.contexthub;
+
+/**
+ * Contains information provided as a response to a NanSessionRequest.
+ */
+@VintfStability
+parcelable NanSessionStateUpdate {
+ /**
+ * True if the NAN session is currently enabled.
+ */
+ boolean state;
+}
diff --git a/contexthub/aidl/default/ContextHub.cpp b/contexthub/aidl/default/ContextHub.cpp
index b98bfb2..66f9857 100644
--- a/contexthub/aidl/default/ContextHub.cpp
+++ b/contexthub/aidl/default/ContextHub.cpp
@@ -87,7 +87,7 @@
return ndk::ScopedAStatus::ok();
}
-ScopedAStatus ContextHub::onNanSessionStateChanged(bool /*sin_state*/) {
+ScopedAStatus ContextHub::onNanSessionStateChanged(const NanSessionStateUpdate& /*in_update*/) {
return ndk::ScopedAStatus::ok();
}
diff --git a/contexthub/aidl/default/include/contexthub-impl/ContextHub.h b/contexthub/aidl/default/include/contexthub-impl/ContextHub.h
index dc9aef0..02ecf53 100644
--- a/contexthub/aidl/default/include/contexthub-impl/ContextHub.h
+++ b/contexthub/aidl/default/include/contexthub-impl/ContextHub.h
@@ -48,7 +48,7 @@
::ndk::ScopedAStatus onHostEndpointConnected(const HostEndpointInfo& in_info) override;
::ndk::ScopedAStatus onHostEndpointDisconnected(char16_t in_hostEndpointId) override;
- ::ndk::ScopedAStatus onNanSessionStateChanged(bool in_state) override;
+ ::ndk::ScopedAStatus onNanSessionStateChanged(const NanSessionStateUpdate& in_update) override;
private:
static constexpr uint32_t kMockHubId = 0;
diff --git a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp
index b227e4a..9707ecf 100644
--- a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp
+++ b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp
@@ -42,6 +42,8 @@
using ::android::hardware::contexthub::NanoappBinary;
using ::android::hardware::contexthub::NanoappInfo;
using ::android::hardware::contexthub::NanoappRpcService;
+using ::android::hardware::contexthub::NanSessionRequest;
+using ::android::hardware::contexthub::NanSessionStateUpdate;
using ::android::hardware::contexthub::Setting;
using ::android::hardware::contexthub::vts_utils::kNonExistentAppId;
using ::android::hardware::contexthub::vts_utils::waitForCallback;
@@ -121,7 +123,9 @@
return Status::ok();
}
- Status handleNanSessionRequest(bool /* enable */) override { return Status::ok(); }
+ Status handleNanSessionRequest(const NanSessionRequest& /* request */) override {
+ return Status::ok();
+ }
};
TEST_P(ContextHubAidl, TestRegisterCallback) {
@@ -153,7 +157,9 @@
return Status::ok();
}
- Status handleNanSessionRequest(bool /* enable */) override { return Status::ok(); }
+ Status handleNanSessionRequest(const NanSessionRequest& /* request */) override {
+ return Status::ok();
+ }
std::promise<std::vector<NanoappInfo>> promise;
};
@@ -218,7 +224,9 @@
return Status::ok();
}
- Status handleNanSessionRequest(bool /* enable */) override { return Status::ok(); }
+ Status handleNanSessionRequest(const NanSessionRequest& /* request */) override {
+ return Status::ok();
+ }
uint32_t expectedTransactionId = 0;
std::promise<bool> promise;
@@ -382,8 +390,11 @@
}
TEST_P(ContextHubAidl, TestNanSessionStateChange) {
- ASSERT_TRUE(contextHub->onNanSessionStateChanged(true /*state*/).isOk());
- ASSERT_TRUE(contextHub->onNanSessionStateChanged(false /*state*/).isOk());
+ NanSessionStateUpdate update;
+ update.state = true;
+ ASSERT_TRUE(contextHub->onNanSessionStateChanged(update).isOk());
+ update.state = false;
+ ASSERT_TRUE(contextHub->onNanSessionStateChanged(update).isOk());
}
std::string PrintGeneratedTest(const testing::TestParamInfo<ContextHubAidl::ParamType>& info) {
diff --git a/current.txt b/current.txt
index 358d05a..c40f9ea 100644
--- a/current.txt
+++ b/current.txt
@@ -935,5 +935,6 @@
4f1a02d21a22104c734f71cdbba19b6f7e93d4ee107ff79f0dbdd171a8430e0e android.hardware.automotive.vehicle@2.0::types
a2fbd9747fbb9ceb8c1090b5a24138312246502d5af0654a8c2b603a9bf521fc android.hardware.gnss@1.0::IGnssCallback
889b59e3e7a59afa67bf19882a44f51a2f9e43b6556ec52baa9ec3efd1ef7fbe android.hardware.camera.device@3.2::types
+db37a1c757e2e69b1ec9c75a981a6987bd87a131d92ab6acc00e04d19f374281 android.hardware.automotive.vehicle@2.0::types
# There will be no more HIDL HALs. Use AIDL instead.
diff --git a/gatekeeper/1.0/default/OWNERS b/gatekeeper/1.0/default/OWNERS
index 335660d..c97fba6 100644
--- a/gatekeeper/1.0/default/OWNERS
+++ b/gatekeeper/1.0/default/OWNERS
@@ -1,2 +1,3 @@
+# Bug component: 1124862
jdanis@google.com
swillden@google.com
diff --git a/gatekeeper/1.0/software/OWNERS b/gatekeeper/1.0/software/OWNERS
index 335660d..c97fba6 100644
--- a/gatekeeper/1.0/software/OWNERS
+++ b/gatekeeper/1.0/software/OWNERS
@@ -1,2 +1,3 @@
+# Bug component: 1124862
jdanis@google.com
swillden@google.com
diff --git a/gatekeeper/aidl/vts/functional/Android.bp b/gatekeeper/aidl/vts/functional/Android.bp
index 2fa80de..008f25c 100644
--- a/gatekeeper/aidl/vts/functional/Android.bp
+++ b/gatekeeper/aidl/vts/functional/Android.bp
@@ -24,14 +24,17 @@
defaults: [
"VtsHalTargetTestDefaults",
"use_libaidlvintf_gtest_helper_static",
- "keymint_use_latest_hal_aidl_ndk_shared",
+ "keymint_use_latest_hal_aidl_ndk_static",
],
srcs: ["VtsHalGatekeeperTargetTest.cpp"],
shared_libs: [
"libbinder_ndk",
"libbase",
],
- static_libs: ["android.hardware.gatekeeper-V1-ndk"],
+ static_libs: [
+ "android.hardware.gatekeeper-V1-ndk",
+ "android.hardware.security.secureclock-V1-ndk",
+ ],
test_suites: [
"general-tests",
"vts",
diff --git a/graphics/composer/aidl/vts/GraphicsComposerCallback.cpp b/graphics/composer/aidl/vts/GraphicsComposerCallback.cpp
index 4fb5d01..7b3a2b4 100644
--- a/graphics/composer/aidl/vts/GraphicsComposerCallback.cpp
+++ b/graphics/composer/aidl/vts/GraphicsComposerCallback.cpp
@@ -29,6 +29,11 @@
mVsyncAllowed = allowed;
}
+void GraphicsComposerCallback::setRefreshRateChangedDebugDataEnabledCallbackAllowed(bool allowed) {
+ std::scoped_lock lock(mMutex);
+ mRefreshRateChangedDebugDataEnabledCallbackAllowed = allowed;
+}
+
std::vector<int64_t> GraphicsComposerCallback::getDisplays() const {
std::scoped_lock lock(mMutex);
return mDisplays;
@@ -79,6 +84,21 @@
return ret;
}
+std::vector<RefreshRateChangedDebugData>
+GraphicsComposerCallback::takeListOfRefreshRateChangedDebugData() {
+ std::scoped_lock lock(mMutex);
+
+ std::vector<RefreshRateChangedDebugData> ret;
+ ret.swap(mRefreshRateChangedDebugData);
+
+ return ret;
+}
+
+int32_t GraphicsComposerCallback::getInvalidRefreshRateDebugEnabledCallbackCount() const {
+ std::scoped_lock lock(mMutex);
+ return mInvalidRefreshRateDebugEnabledCallbackCount;
+}
+
::ndk::ScopedAStatus GraphicsComposerCallback::onHotplug(int64_t in_display, bool in_connected) {
std::scoped_lock lock(mMutex);
@@ -125,9 +145,16 @@
}
::ndk::ScopedAStatus GraphicsComposerCallback::onRefreshRateChangedDebug(
- const RefreshRateChangedDebugData&) {
- // TODO(b/202734676) Add implementation for Vts tests
- return ::ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+ const RefreshRateChangedDebugData& data) {
+ std::scoped_lock lock(mMutex);
+
+ const auto it = std::find(mDisplays.begin(), mDisplays.end(), data.display);
+ if (mRefreshRateChangedDebugDataEnabledCallbackAllowed && it != mDisplays.end()) {
+ mRefreshRateChangedDebugData.push_back(data);
+ } else {
+ mInvalidRefreshRateDebugEnabledCallbackCount++;
+ }
+ return ::ndk::ScopedAStatus::ok();
}
::ndk::ScopedAStatus GraphicsComposerCallback::onVsyncPeriodTimingChanged(
diff --git a/graphics/composer/aidl/vts/GraphicsComposerCallback.h b/graphics/composer/aidl/vts/GraphicsComposerCallback.h
index 9c3bc70..13e992a 100644
--- a/graphics/composer/aidl/vts/GraphicsComposerCallback.h
+++ b/graphics/composer/aidl/vts/GraphicsComposerCallback.h
@@ -26,6 +26,8 @@
public:
void setVsyncAllowed(bool allowed);
+ void setRefreshRateChangedDebugDataEnabledCallbackAllowed(bool allowed);
+
std::vector<int64_t> getDisplays() const;
int32_t getInvalidHotplugCount() const;
@@ -44,6 +46,10 @@
std::optional<VsyncPeriodChangeTimeline> takeLastVsyncPeriodChangeTimeline();
+ std::vector<RefreshRateChangedDebugData> takeListOfRefreshRateChangedDebugData();
+
+ int32_t getInvalidRefreshRateDebugEnabledCallbackCount() const;
+
private:
virtual ::ndk::ScopedAStatus onHotplug(int64_t in_display, bool in_connected) override;
virtual ::ndk::ScopedAStatus onRefresh(int64_t in_display) override;
@@ -63,9 +69,13 @@
std::vector<int64_t> mDisplays GUARDED_BY(mMutex);
// true only when vsync is enabled
bool mVsyncAllowed GUARDED_BY(mMutex) = true;
+ // true only when RefreshRateChangedCallbackDebugEnabled is set to true.
+ bool mRefreshRateChangedDebugDataEnabledCallbackAllowed GUARDED_BY(mMutex) = false;
std::optional<VsyncPeriodChangeTimeline> mTimeline GUARDED_BY(mMutex);
+ std::vector<RefreshRateChangedDebugData> mRefreshRateChangedDebugData GUARDED_BY(mMutex);
+
int32_t mVsyncIdleCount GUARDED_BY(mMutex) = 0;
int64_t mVsyncIdleTime GUARDED_BY(mMutex) = 0;
@@ -75,6 +85,7 @@
int32_t mInvalidVsyncCount GUARDED_BY(mMutex) = 0;
int32_t mInvalidVsyncPeriodChangeCount GUARDED_BY(mMutex) = 0;
int32_t mInvalidSeamlessPossibleCount GUARDED_BY(mMutex) = 0;
+ int32_t mInvalidRefreshRateDebugEnabledCallbackCount GUARDED_BY(mMutex) = 0;
};
} // namespace aidl::android::hardware::graphics::composer3::vts
diff --git a/graphics/composer/aidl/vts/VtsComposerClient.cpp b/graphics/composer/aidl/vts/VtsComposerClient.cpp
index e03ef25..25b0ca0 100644
--- a/graphics/composer/aidl/vts/VtsComposerClient.cpp
+++ b/graphics/composer/aidl/vts/VtsComposerClient.cpp
@@ -119,6 +119,24 @@
return updateDisplayProperties(vtsDisplay, config);
}
+ScopedAStatus VtsComposerClient::setPeakRefreshRateConfig(VtsDisplay* vtsDisplay) {
+ const auto displayId = vtsDisplay->getDisplayId();
+ auto [activeStatus, activeConfig] = getActiveConfig(displayId);
+ EXPECT_TRUE(activeStatus.isOk());
+ auto peakDisplayConfig = vtsDisplay->getDisplayConfig(activeConfig);
+ auto peakConfig = activeConfig;
+
+ const auto displayConfigs = vtsDisplay->getDisplayConfigs();
+ for (const auto [config, displayConfig] : displayConfigs) {
+ if (displayConfig.configGroup == peakDisplayConfig.configGroup &&
+ displayConfig.vsyncPeriod < peakDisplayConfig.vsyncPeriod) {
+ peakDisplayConfig = displayConfig;
+ peakConfig = config;
+ }
+ }
+ return setActiveConfig(vtsDisplay, peakConfig);
+}
+
std::pair<ScopedAStatus, int32_t> VtsComposerClient::getDisplayAttribute(
int64_t display, int32_t config, DisplayAttribute displayAttribute) {
int32_t outDisplayAttribute;
@@ -375,10 +393,15 @@
return mComposerCallback->getVsyncIdleTime();
}
-ndk::ScopedAStatus VtsComposerClient::setRefreshRateChangedCallbackDebugEnabled(
- int64_t /* display */, bool /* enabled */) {
- // TODO(b/202734676) Add implementation for VTS tests
- return ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+ndk::ScopedAStatus VtsComposerClient::setRefreshRateChangedCallbackDebugEnabled(int64_t display,
+ bool enabled) {
+ mComposerCallback->setRefreshRateChangedDebugDataEnabledCallbackAllowed(enabled);
+ return mComposerClient->setRefreshRateChangedCallbackDebugEnabled(display, enabled);
+}
+
+std::vector<RefreshRateChangedDebugData>
+VtsComposerClient::takeListOfRefreshRateChangedDebugData() {
+ return mComposerCallback->takeListOfRefreshRateChangedDebugData();
}
int64_t VtsComposerClient::getInvalidDisplayId() {
@@ -545,6 +568,10 @@
ALOGE("Invalid seamless possible count");
isValid = false;
}
+ if (mComposerCallback->getInvalidRefreshRateDebugEnabledCallbackCount() != 0) {
+ ALOGE("Invalid refresh rate debug enabled callback count");
+ isValid = false;
+ }
}
return isValid;
}
diff --git a/graphics/composer/aidl/vts/VtsComposerClient.h b/graphics/composer/aidl/vts/VtsComposerClient.h
index 81a62b3..ea3318c 100644
--- a/graphics/composer/aidl/vts/VtsComposerClient.h
+++ b/graphics/composer/aidl/vts/VtsComposerClient.h
@@ -77,6 +77,8 @@
ScopedAStatus setActiveConfig(VtsDisplay* vtsDisplay, int32_t config);
+ ScopedAStatus setPeakRefreshRateConfig(VtsDisplay* vtsDisplay);
+
std::pair<ScopedAStatus, int32_t> getDisplayAttribute(int64_t display, int32_t config,
DisplayAttribute displayAttribute);
@@ -183,6 +185,10 @@
std::pair<ScopedAStatus, OverlayProperties> getOverlaySupport();
+ ndk::ScopedAStatus setRefreshRateChangedCallbackDebugEnabled(int64_t display, bool enabled);
+
+ std::vector<RefreshRateChangedDebugData> takeListOfRefreshRateChangedDebugData();
+
private:
ScopedAStatus addDisplayConfig(VtsDisplay* vtsDisplay, int32_t config);
ScopedAStatus updateDisplayProperties(VtsDisplay* vtsDisplay, int32_t config);
@@ -197,9 +203,6 @@
bool verifyComposerCallbackParams();
- ndk::ScopedAStatus setRefreshRateChangedCallbackDebugEnabled(int64_t /* display */,
- bool /* enabled */);
-
// Keep track of displays and layers. When a test fails/ends,
// the VtsComposerClient::tearDown should be called from the
// test tearDown to clean up the resources for the test.
@@ -245,15 +248,17 @@
};
void addDisplayConfig(int32_t config, DisplayConfig displayConfig) {
- displayConfigs.insert({config, displayConfig});
+ mDisplayConfigs.insert({config, displayConfig});
}
- DisplayConfig getDisplayConfig(int32_t config) { return displayConfigs.find(config)->second; }
+ DisplayConfig getDisplayConfig(int32_t config) { return mDisplayConfigs.find(config)->second; }
+
+ std::unordered_map<int32_t, DisplayConfig> getDisplayConfigs() { return mDisplayConfigs; }
private:
int64_t mDisplayId;
int32_t mDisplayWidth;
int32_t mDisplayHeight;
- std::unordered_map<int32_t, DisplayConfig> displayConfigs;
+ std::unordered_map<int32_t, DisplayConfig> mDisplayConfigs;
};
} // namespace aidl::android::hardware::graphics::composer3::vts
diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
index 4974e71..1ecd405 100644
--- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
+++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
@@ -1217,6 +1217,14 @@
}
}
+ bool checkIfCallbackRefreshRateChangedDebugEnabledReceived(
+ std::function<bool(RefreshRateChangedDebugData)> filter) {
+ const auto list = mComposerClient->takeListOfRefreshRateChangedDebugData();
+ return std::any_of(list.begin(), list.end(), [&](auto refreshRateChangedDebugData) {
+ return filter(refreshRateChangedDebugData);
+ });
+ }
+
sp<GraphicBuffer> allocate(::android::PixelFormat pixelFormat) {
return sp<GraphicBuffer>::make(
static_cast<uint32_t>(getPrimaryDisplay().getDisplayWidth()),
@@ -1316,7 +1324,7 @@
return vsyncPeriod;
}
- int64_t createOnScreenLayer() {
+ int64_t createOnScreenLayer(Composition composition = Composition::DEVICE) {
const auto& [status, layer] =
mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
EXPECT_TRUE(status.isOk());
@@ -1324,12 +1332,25 @@
getPrimaryDisplay().getDisplayHeight()};
FRect cropRect{0, 0, (float)getPrimaryDisplay().getDisplayWidth(),
(float)getPrimaryDisplay().getDisplayHeight()};
- configureLayer(getPrimaryDisplay(), layer, Composition::DEVICE, displayFrame, cropRect);
+ configureLayer(getPrimaryDisplay(), layer, composition, displayFrame, cropRect);
auto& writer = getWriter(getPrimaryDisplayId());
writer.setLayerDataspace(getPrimaryDisplayId(), layer, common::Dataspace::UNKNOWN);
return layer;
}
+ void sendBufferUpdate(int64_t layer) {
+ const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888);
+ ASSERT_NE(nullptr, buffer->handle);
+
+ auto& writer = getWriter(getPrimaryDisplayId());
+ writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, buffer->handle,
+ /*acquireFence*/ -1);
+
+ const sp<::android::Fence> presentFence =
+ presentAndGetFence(ComposerClientWriter::kNoTimestamp);
+ presentFence->waitForever(LOG_TAG);
+ }
+
bool hasDisplayCapability(int64_t display, DisplayCapability cap) {
const auto& [status, capabilities] = mComposerClient->getDisplayCapabilities(display);
EXPECT_TRUE(status.isOk());
@@ -2268,6 +2289,176 @@
EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::OFF).isOk());
}
+TEST_P(GraphicsComposerAidlCommandTest, SetRefreshRateChangedCallbackDebug_Unsupported) {
+ if (!hasCapability(Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG)) {
+ auto status = mComposerClient->setRefreshRateChangedCallbackDebugEnabled(
+ getPrimaryDisplayId(), /*enabled*/ true);
+ EXPECT_FALSE(status.isOk());
+ EXPECT_NO_FATAL_FAILURE(
+ assertServiceSpecificError(status, IComposerClient::EX_UNSUPPORTED));
+
+ status = mComposerClient->setRefreshRateChangedCallbackDebugEnabled(getPrimaryDisplayId(),
+ /*enabled*/ false);
+ EXPECT_FALSE(status.isOk());
+ EXPECT_NO_FATAL_FAILURE(
+ assertServiceSpecificError(status, IComposerClient::EX_UNSUPPORTED));
+ }
+}
+
+TEST_P(GraphicsComposerAidlCommandTest, SetRefreshRateChangedCallbackDebug_Enabled) {
+ if (!hasCapability(Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG)) {
+ GTEST_SUCCEED() << "Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG is not supported";
+ return;
+ }
+
+ const auto displayId = getPrimaryDisplayId();
+ EXPECT_TRUE(mComposerClient->setPowerMode(displayId, PowerMode::ON).isOk());
+ // Enable the callback
+ ASSERT_TRUE(mComposerClient
+ ->setRefreshRateChangedCallbackDebugEnabled(displayId,
+ /*enabled*/ true)
+ .isOk());
+ std::this_thread::sleep_for(100ms);
+
+ const auto displayFilter = [displayId](auto refreshRateChangedDebugData) {
+ return displayId == refreshRateChangedDebugData.display;
+ };
+
+ // Check that we immediately got a callback
+ EXPECT_TRUE(checkIfCallbackRefreshRateChangedDebugEnabledReceived(displayFilter));
+
+ ASSERT_TRUE(mComposerClient
+ ->setRefreshRateChangedCallbackDebugEnabled(displayId,
+ /*enabled*/ false)
+ .isOk());
+}
+
+TEST_P(GraphicsComposerAidlCommandTest,
+ SetRefreshRateChangedCallbackDebugEnabled_noCallbackWhenIdle) {
+ if (!hasCapability(Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG)) {
+ GTEST_SUCCEED() << "Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG is not supported";
+ return;
+ }
+
+ auto display = getEditablePrimaryDisplay();
+ const auto displayId = display.getDisplayId();
+
+ if (!hasDisplayCapability(displayId, DisplayCapability::DISPLAY_IDLE_TIMER)) {
+ GTEST_SUCCEED() << "DisplayCapability::DISPLAY_IDLE_TIMER is not supported";
+ return;
+ }
+
+ EXPECT_TRUE(mComposerClient->setPowerMode(displayId, PowerMode::ON).isOk());
+ EXPECT_TRUE(mComposerClient->setPeakRefreshRateConfig(&display).isOk());
+
+ ASSERT_TRUE(mComposerClient->setIdleTimerEnabled(displayId, /*timeoutMs*/ 500).isOk());
+ // Enable the callback
+ ASSERT_TRUE(mComposerClient
+ ->setRefreshRateChangedCallbackDebugEnabled(displayId,
+ /*enabled*/ true)
+ .isOk());
+
+ const auto displayFilter = [displayId](auto refreshRateChangedDebugData) {
+ return displayId == refreshRateChangedDebugData.display;
+ };
+
+ int retryCount = 3;
+ do {
+ // Wait for 1s so that we enter the idle state
+ std::this_thread::sleep_for(1s);
+ if (!checkIfCallbackRefreshRateChangedDebugEnabledReceived(displayFilter)) {
+ // DID NOT receive a callback, we are in the idle state.
+ break;
+ }
+ } while (--retryCount > 0);
+
+ if (retryCount == 0) {
+ GTEST_SUCCEED() << "Unable to enter the idle mode";
+ return;
+ }
+
+ // Send the REFRESH_RATE_INDICATOR update
+ ASSERT_NO_FATAL_FAILURE(
+ sendBufferUpdate(createOnScreenLayer(Composition::REFRESH_RATE_INDICATOR)));
+ std::this_thread::sleep_for(1s);
+ EXPECT_FALSE(checkIfCallbackRefreshRateChangedDebugEnabledReceived(displayFilter))
+ << "A callback should not be received for REFRESH_RATE_INDICATOR";
+
+ EXPECT_TRUE(mComposerClient
+ ->setRefreshRateChangedCallbackDebugEnabled(displayId,
+ /*enabled*/ false)
+ .isOk());
+}
+
+TEST_P(GraphicsComposerAidlCommandTest,
+ SetRefreshRateChangedCallbackDebugEnabled_SetActiveConfigWithConstraints) {
+ if (!hasCapability(Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG)) {
+ GTEST_SUCCEED() << "Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG is not supported";
+ return;
+ }
+
+ VsyncPeriodChangeConstraints constraints;
+ constraints.seamlessRequired = false;
+ constraints.desiredTimeNanos = systemTime();
+
+ for (VtsDisplay& display : mDisplays) {
+ const auto displayId = display.getDisplayId();
+ EXPECT_TRUE(mComposerClient->setPowerMode(displayId, PowerMode::ON).isOk());
+
+ // Enable the callback
+ ASSERT_TRUE(mComposerClient
+ ->setRefreshRateChangedCallbackDebugEnabled(displayId, /*enabled*/ true)
+ .isOk());
+
+ forEachTwoConfigs(displayId, [&](int32_t config1, int32_t config2) {
+ const int32_t vsyncPeriod1 = display.getDisplayConfig(config1).vsyncPeriod;
+ const int32_t vsyncPeriod2 = display.getDisplayConfig(config2).vsyncPeriod;
+
+ if (vsyncPeriod1 == vsyncPeriod2) {
+ return; // continue
+ }
+
+ EXPECT_TRUE(mComposerClient->setActiveConfig(&display, config1).isOk());
+ sendRefreshFrame(display, nullptr);
+
+ const auto& [status, timeline] =
+ mComposerClient->setActiveConfigWithConstraints(&display, config2, constraints);
+ EXPECT_TRUE(status.isOk());
+
+ if (timeline.refreshRequired) {
+ sendRefreshFrame(display, &timeline);
+ }
+
+ const auto callbackFilter = [displayId,
+ vsyncPeriod2](auto refreshRateChangedDebugData) {
+ constexpr int kVsyncThreshold = 1000;
+ return displayId == refreshRateChangedDebugData.display &&
+ std::abs(vsyncPeriod2 - refreshRateChangedDebugData.vsyncPeriodNanos) <=
+ kVsyncThreshold;
+ };
+
+ int retryCount = 3;
+ do {
+ std::this_thread::sleep_for(100ms);
+ if (checkIfCallbackRefreshRateChangedDebugEnabledReceived(callbackFilter)) {
+ GTEST_SUCCEED() << "Received a callback successfully";
+ break;
+ }
+ } while (--retryCount > 0);
+
+ if (retryCount == 0) {
+ GTEST_FAIL() << "failed to get a callback for the display " << displayId
+ << " with config " << config2;
+ }
+ });
+
+ EXPECT_TRUE(
+ mComposerClient
+ ->setRefreshRateChangedCallbackDebugEnabled(displayId, /*enabled*/ false)
+ .isOk());
+ }
+}
+
/*
* Test that no two display configs are exactly the same.
*/
diff --git a/keymaster/4.0/vts/performance/Benchmark.cpp b/keymaster/4.0/vts/performance/Benchmark.cpp
index 96ef5bf..e5fdff2 100644
--- a/keymaster/4.0/vts/performance/Benchmark.cpp
+++ b/keymaster/4.0/vts/performance/Benchmark.cpp
@@ -315,7 +315,7 @@
SecurityLevel getSecurityLevel() { return securityLevel_; }
- const string& GenerateMessage(int size) {
+ const string GenerateMessage(int size) {
for (const string& message : message_cache_) {
if (message.size() == size) {
return message;
@@ -323,7 +323,7 @@
}
string message = string(size, 'x');
message_cache_.push_back(message);
- return std::move(message);
+ return message;
}
optional<BlockMode> getBlockMode(string transform) {
@@ -714,4 +714,4 @@
return 1;
}
::benchmark::RunSpecifiedBenchmarks();
-}
\ No newline at end of file
+}
diff --git a/media/omx/1.0/vts/functional/store/VtsHalMediaOmxV1_0TargetStoreTest.cpp b/media/omx/1.0/vts/functional/store/VtsHalMediaOmxV1_0TargetStoreTest.cpp
old mode 100755
new mode 100644
index 00e9837..d80e651
--- a/media/omx/1.0/vts/functional/store/VtsHalMediaOmxV1_0TargetStoreTest.cpp
+++ b/media/omx/1.0/vts/functional/store/VtsHalMediaOmxV1_0TargetStoreTest.cpp
@@ -374,21 +374,16 @@
}
}
-static int getFirstApiLevel() {
- int boardApiLevel = android::base::GetIntProperty("ro.board.first_api_level", 0);
- if (boardApiLevel != 0) {
- return boardApiLevel;
- }
-
- return android::base::GetIntProperty("ro.product.first_api_level", __ANDROID_API_T__);
-}
-
static bool isTV() {
return testing::deviceSupportsFeature("android.software.leanback");
}
// list components and roles.
TEST_P(StoreHidlTest, OmxCodecAllowedTest) {
+ static int sBoardFirstApiLevel = android::base::GetIntProperty("ro.board.first_api_level", 0);
+ if (sBoardFirstApiLevel == 0) {
+ GTEST_SKIP() << "board first API level not detected";
+ }
hidl_vec<IOmx::ComponentInfo> componentInfos = getComponentInfoList(omx);
for (IOmx::ComponentInfo info : componentInfos) {
for (std::string role : info.mRoles) {
@@ -396,27 +391,27 @@
role.find("video_encoder") != std::string::npos) {
// Codec2 is not mandatory on Android TV devices that launched with Android S
if (isTV()) {
- ASSERT_LT(getFirstApiLevel(), __ANDROID_API_T__)
+ ASSERT_LT(sBoardFirstApiLevel, __ANDROID_API_T__)
<< " Component: " << info.mName.c_str() << " Role: " << role.c_str()
<< " not allowed for devices launching with Android T and above";
} else {
std::string codecName = info.mName;
bool isAndroidCodec = (codecName.rfind("OMX.google", 0) != std::string::npos);
- if (isAndroidCodec && (getFirstApiLevel() <= __ANDROID_API_S__)) {
+ if (isAndroidCodec && (sBoardFirstApiLevel <= __ANDROID_API_S__)) {
// refer b/230582620
// S AOSP build did not remove the OMX.google video codecs
// so it is infeasible to require no OMX.google.* video codecs
// on S launching devices
} else {
- ASSERT_LT(getFirstApiLevel(), __ANDROID_API_S__)
- << " Component: " << info.mName.c_str() << " Role: " << role.c_str()
- << " not allowed for devices launching with Android S and above";
+ ASSERT_LT(sBoardFirstApiLevel, __ANDROID_API_S__)
+ << " Component: " << info.mName.c_str() << " Role: " << role.c_str()
+ << " not allowed for devices launching with Android S and above";
}
}
}
if (role.find("audio_decoder") != std::string::npos ||
role.find("audio_encoder") != std::string::npos) {
- ASSERT_LT(getFirstApiLevel(), __ANDROID_API_T__)
+ ASSERT_LT(sBoardFirstApiLevel, __ANDROID_API_T__)
<< " Component: " << info.mName.c_str() << " Role: " << role.c_str()
<< " not allowed for devices launching with Android T and above";
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrMode.aidl
index 84376b7..37e3b25 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrMode.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrMode.aidl
@@ -34,13 +34,13 @@
package android.hardware.radio.ims.media;
@Backing(type="int") @VintfStability
enum AmrMode {
- AMR_MODE_0 = (1 << 0),
- AMR_MODE_1 = (1 << 1),
- AMR_MODE_2 = (1 << 2),
- AMR_MODE_3 = (1 << 3),
- AMR_MODE_4 = (1 << 4),
- AMR_MODE_5 = (1 << 5),
- AMR_MODE_6 = (1 << 6),
- AMR_MODE_7 = (1 << 7),
- AMR_MODE_8 = (1 << 8),
+ AMR_MODE_0 = (1 << 0) /* 1 */,
+ AMR_MODE_1 = (1 << 1) /* 2 */,
+ AMR_MODE_2 = (1 << 2) /* 4 */,
+ AMR_MODE_3 = (1 << 3) /* 8 */,
+ AMR_MODE_4 = (1 << 4) /* 16 */,
+ AMR_MODE_5 = (1 << 5) /* 32 */,
+ AMR_MODE_6 = (1 << 6) /* 64 */,
+ AMR_MODE_7 = (1 << 7) /* 128 */,
+ AMR_MODE_8 = (1 << 8) /* 256 */,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecType.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecType.aidl
index 9eaf129..e4193cd 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecType.aidl
@@ -34,9 +34,9 @@
package android.hardware.radio.ims.media;
@Backing(type="int") @VintfStability
enum CodecType {
- AMR = (1 << 0),
- AMR_WB = (1 << 1),
- EVS = (1 << 2),
- PCMA = (1 << 3),
- PCMU = (1 << 4),
+ AMR = (1 << 0) /* 1 */,
+ AMR_WB = (1 << 1) /* 2 */,
+ EVS = (1 << 2) /* 4 */,
+ PCMA = (1 << 3) /* 8 */,
+ PCMU = (1 << 4) /* 16 */,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsBandwidth.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsBandwidth.aidl
index 5e80f91..db3eb29 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsBandwidth.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsBandwidth.aidl
@@ -35,8 +35,8 @@
@Backing(type="int") @VintfStability
enum EvsBandwidth {
NONE = 0,
- NARROW_BAND = (1 << 0),
- WIDE_BAND = (1 << 1),
- SUPER_WIDE_BAND = (1 << 2),
- FULL_BAND = (1 << 3),
+ NARROW_BAND = (1 << 0) /* 1 */,
+ WIDE_BAND = (1 << 1) /* 2 */,
+ SUPER_WIDE_BAND = (1 << 2) /* 4 */,
+ FULL_BAND = (1 << 3) /* 8 */,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsMode.aidl
index a530a8d..fb1f14d 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsMode.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsMode.aidl
@@ -34,25 +34,25 @@
package android.hardware.radio.ims.media;
@Backing(type="int") @VintfStability
enum EvsMode {
- EVS_MODE_0 = (1 << 0),
- EVS_MODE_1 = (1 << 1),
- EVS_MODE_2 = (1 << 2),
- EVS_MODE_3 = (1 << 3),
- EVS_MODE_4 = (1 << 4),
- EVS_MODE_5 = (1 << 5),
- EVS_MODE_6 = (1 << 6),
- EVS_MODE_7 = (1 << 7),
- EVS_MODE_8 = (1 << 8),
- EVS_MODE_9 = (1 << 9),
- EVS_MODE_10 = (1 << 10),
- EVS_MODE_11 = (1 << 11),
- EVS_MODE_12 = (1 << 12),
- EVS_MODE_13 = (1 << 13),
- EVS_MODE_14 = (1 << 14),
- EVS_MODE_15 = (1 << 15),
- EVS_MODE_16 = (1 << 16),
- EVS_MODE_17 = (1 << 17),
- EVS_MODE_18 = (1 << 18),
- EVS_MODE_19 = (1 << 19),
- EVS_MODE_20 = (1 << 20),
+ EVS_MODE_0 = (1 << 0) /* 1 */,
+ EVS_MODE_1 = (1 << 1) /* 2 */,
+ EVS_MODE_2 = (1 << 2) /* 4 */,
+ EVS_MODE_3 = (1 << 3) /* 8 */,
+ EVS_MODE_4 = (1 << 4) /* 16 */,
+ EVS_MODE_5 = (1 << 5) /* 32 */,
+ EVS_MODE_6 = (1 << 6) /* 64 */,
+ EVS_MODE_7 = (1 << 7) /* 128 */,
+ EVS_MODE_8 = (1 << 8) /* 256 */,
+ EVS_MODE_9 = (1 << 9) /* 512 */,
+ EVS_MODE_10 = (1 << 10) /* 1024 */,
+ EVS_MODE_11 = (1 << 11) /* 2048 */,
+ EVS_MODE_12 = (1 << 12) /* 4096 */,
+ EVS_MODE_13 = (1 << 13) /* 8192 */,
+ EVS_MODE_14 = (1 << 14) /* 16384 */,
+ EVS_MODE_15 = (1 << 15) /* 32768 */,
+ EVS_MODE_16 = (1 << 16) /* 65536 */,
+ EVS_MODE_17 = (1 << 17) /* 131072 */,
+ EVS_MODE_18 = (1 << 18) /* 262144 */,
+ EVS_MODE_19 = (1 << 19) /* 524288 */,
+ EVS_MODE_20 = (1 << 20) /* 1048576 */,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaDirection.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaDirection.aidl
index d90b2a4..0e9eaee 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaDirection.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaDirection.aidl
@@ -35,8 +35,8 @@
@Backing(type="int") @VintfStability
enum MediaDirection {
NO_FLOW = 0,
- SEND_ONLY = 1,
- RECEIVE_ONLY = 2,
- SEND_RECEIVE = 3,
- INACTIVE = 4,
+ RTP_TX = (1 << 0) /* 1 */,
+ RTP_RX = (1 << 1) /* 2 */,
+ RTCP_TX = (1 << 2) /* 4 */,
+ RTCP_RX = (1 << 3) /* 8 */,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl
index 0663754..289c810 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl
@@ -35,11 +35,11 @@
@Backing(type="int") @VintfStability
enum RtcpXrReportBlockType {
RTCPXR_NONE = 0,
- RTCPXR_LOSS_RLE_REPORT_BLOCK = (1 << 0),
- RTCPXR_DUPLICATE_RLE_REPORT_BLOCK = (1 << 1),
- RTCPXR_PACKET_RECEIPT_TIMES_REPORT_BLOCK = (1 << 2),
- RTCPXR_RECEIVER_REFERENCE_TIME_REPORT_BLOCK = (1 << 3),
- RTCPXR_DLRR_REPORT_BLOCK = (1 << 4),
- RTCPXR_STATISTICS_SUMMARY_REPORT_BLOCK = (1 << 5),
- RTCPXR_VOIP_METRICS_REPORT_BLOCK = (1 << 6),
+ RTCPXR_LOSS_RLE_REPORT_BLOCK = (1 << 0) /* 1 */,
+ RTCPXR_DUPLICATE_RLE_REPORT_BLOCK = (1 << 1) /* 2 */,
+ RTCPXR_PACKET_RECEIPT_TIMES_REPORT_BLOCK = (1 << 2) /* 4 */,
+ RTCPXR_RECEIVER_REFERENCE_TIME_REPORT_BLOCK = (1 << 3) /* 8 */,
+ RTCPXR_DLRR_REPORT_BLOCK = (1 << 4) /* 16 */,
+ RTCPXR_STATISTICS_SUMMARY_REPORT_BLOCK = (1 << 5) /* 32 */,
+ RTCPXR_VOIP_METRICS_REPORT_BLOCK = (1 << 6) /* 64 */,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpConfig.aidl
index 1a8921e..8a826f6 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpConfig.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpConfig.aidl
@@ -34,7 +34,7 @@
package android.hardware.radio.ims.media;
@VintfStability
parcelable RtpConfig {
- android.hardware.radio.ims.media.MediaDirection direction;
+ int direction;
android.hardware.radio.AccessNetwork accessNetwork;
android.hardware.radio.ims.media.RtpAddress remoteAddress;
android.hardware.radio.ims.media.RtpSessionParams sessionParams;
diff --git a/radio/aidl/android/hardware/radio/ims/media/MediaDirection.aidl b/radio/aidl/android/hardware/radio/ims/media/MediaDirection.aidl
index 9f04d8e..e5c34c7 100644
--- a/radio/aidl/android/hardware/radio/ims/media/MediaDirection.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/MediaDirection.aidl
@@ -16,6 +16,17 @@
package android.hardware.radio.ims.media;
+/**
+ * Directions can be combined to meet various media direction
+ * requirements depending on the scenario.
+ *
+ * Examples:
+ * No Flow : NO_FLOW - eg. SRVCC.
+ * RTCP-only : RTCP_TX | RTCP_RX - eg. Local Hold or Dual Hold.
+ * Receive-Only : RTP_RX | RTCP_TX | RTCP_RX - eg. Remote Hold.
+ * Send-Receive : RTP_TX | RTP_RX | RTCP_TX | RTCP_RX - eg. Active call.
+ * Send-Only : RTP_TX | RTCP_TX | RTCP_RX - eg. Simplex call, voice mail, etc
+ */
@VintfStability
@Backing(type="int")
enum MediaDirection {
@@ -24,12 +35,16 @@
* may release the audio resource. Eg. SRVCC.
*/
NO_FLOW = 0,
- /** Device sends outgoing RTP and drops incoming RTP */
- SEND_ONLY = 1,
- /** Device receives the downlink RTP and does not transmit any uplink RTP */
- RECEIVE_ONLY = 2,
- /** Device sends and receive RTP in both directions */
- SEND_RECEIVE = 3,
- /** No RTP flow however RTCP continues to flow. Eg. HOLD */
- INACTIVE = 4,
+
+ /** Send RTP packets */
+ RTP_TX = 1 << 0,
+
+ /** Receive and processes RTP packets */
+ RTP_RX = 1 << 1,
+
+ /** Send RTCP packets */
+ RTCP_TX = 1 << 2,
+
+ /** Receive RTCP packets */
+ RTCP_RX = 1 << 3,
}
diff --git a/radio/aidl/android/hardware/radio/ims/media/RtpConfig.aidl b/radio/aidl/android/hardware/radio/ims/media/RtpConfig.aidl
index f6696f7..f93b112 100644
--- a/radio/aidl/android/hardware/radio/ims/media/RtpConfig.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/RtpConfig.aidl
@@ -18,15 +18,14 @@
import android.hardware.radio.AccessNetwork;
import android.hardware.radio.ims.media.AnbrMode;
-import android.hardware.radio.ims.media.MediaDirection;
import android.hardware.radio.ims.media.RtcpConfig;
import android.hardware.radio.ims.media.RtpAddress;
import android.hardware.radio.ims.media.RtpSessionParams;
@VintfStability
parcelable RtpConfig {
- /** Media flow direction */
- MediaDirection direction;
+ /** Media flow direction. The bitfield of MediaDirection(s) */
+ int direction;
/** Radio Access Network */
AccessNetwork accessNetwork;
/** IP address and port number of the other party for RTP media */
diff --git a/radio/aidl/vts/radio_imsmedia_test.cpp b/radio/aidl/vts/radio_imsmedia_test.cpp
index d9e57c9..2b6f5ef 100644
--- a/radio/aidl/vts/radio_imsmedia_test.cpp
+++ b/radio/aidl/vts/radio_imsmedia_test.cpp
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+#include <aidl/android/hardware/radio/ims/media/MediaDirection.h>
#include <android-base/logging.h>
#include <android/binder_auto_utils.h>
#include <android/binder_manager.h>
@@ -44,8 +45,10 @@
int32_t sessionId = 1;
RtpConfig modifyRtpConfig;
- modifyRtpConfig.direction =
- ::aidl::android::hardware::radio::ims::media::MediaDirection::SEND_RECEIVE;
+ modifyRtpConfig.direction = static_cast<int32_t>(MediaDirection::RTP_TX) |
+ static_cast<int32_t>(MediaDirection::RTP_RX) |
+ static_cast<int32_t>(MediaDirection::RTCP_TX) |
+ static_cast<int32_t>(MediaDirection::RTCP_RX);
modifyRtpConfig.remoteAddress.ipAddress = "122.22.22.33";
modifyRtpConfig.remoteAddress.portNumber = 1234;
@@ -90,8 +93,10 @@
int32_t duration = 200;
RtpConfig modifyRtpConfig;
- modifyRtpConfig.direction =
- ::aidl::android::hardware::radio::ims::media::MediaDirection::SEND_RECEIVE;
+ modifyRtpConfig.direction = static_cast<int32_t>(MediaDirection::RTP_TX) |
+ static_cast<int32_t>(MediaDirection::RTP_RX) |
+ static_cast<int32_t>(MediaDirection::RTCP_TX) |
+ static_cast<int32_t>(MediaDirection::RTCP_RX);
modifyRtpConfig.remoteAddress.ipAddress = "122.22.22.33";
modifyRtpConfig.remoteAddress.portNumber = 1234;
@@ -143,8 +148,10 @@
std::vector<RtpHeaderExtension> extensions;
RtpConfig modifyRtpConfig;
- modifyRtpConfig.direction =
- ::aidl::android::hardware::radio::ims::media::MediaDirection::SEND_RECEIVE;
+ modifyRtpConfig.direction = static_cast<int32_t>(MediaDirection::RTP_TX) |
+ static_cast<int32_t>(MediaDirection::RTP_RX) |
+ static_cast<int32_t>(MediaDirection::RTCP_TX) |
+ static_cast<int32_t>(MediaDirection::RTCP_RX);
modifyRtpConfig.remoteAddress.ipAddress = "122.22.22.33";
modifyRtpConfig.remoteAddress.portNumber = 1234;
@@ -190,8 +197,10 @@
MediaQualityThreshold threshold;
RtpConfig modifyRtpConfig;
- modifyRtpConfig.direction =
- ::aidl::android::hardware::radio::ims::media::MediaDirection::SEND_RECEIVE;
+ modifyRtpConfig.direction = static_cast<int32_t>(MediaDirection::RTP_TX) |
+ static_cast<int32_t>(MediaDirection::RTP_RX) |
+ static_cast<int32_t>(MediaDirection::RTCP_TX) |
+ static_cast<int32_t>(MediaDirection::RTCP_RX);
modifyRtpConfig.remoteAddress.ipAddress = "122.22.22.33";
modifyRtpConfig.remoteAddress.portNumber = 1234;
@@ -243,13 +252,14 @@
localEndPoint.rtcpFd = ndk::ScopedFileDescriptor(mRtcpSocketFd);
localEndPoint.modemId = 1;
- rtpConfig.direction =
- ::aidl::android::hardware::radio::ims::media::MediaDirection::SEND_RECEIVE;
+ rtpConfig.direction = static_cast<int32_t>(MediaDirection::RTP_TX) |
+ static_cast<int32_t>(MediaDirection::RTP_RX) |
+ static_cast<int32_t>(MediaDirection::RTCP_TX) |
+ static_cast<int32_t>(MediaDirection::RTCP_RX);
rtpConfig.remoteAddress.ipAddress = "122.22.22.22";
rtpConfig.remoteAddress.portNumber = 2222;
result = radio_imsmedia->openSession(sessionId, localEndPoint, rtpConfig);
-
return result;
}
diff --git a/secure_element/aidl/android/hardware/secure_element/ISecureElement.aidl b/secure_element/aidl/android/hardware/secure_element/ISecureElement.aidl
index b9ce9d1..8c0dd6d 100644
--- a/secure_element/aidl/android/hardware/secure_element/ISecureElement.aidl
+++ b/secure_element/aidl/android/hardware/secure_element/ISecureElement.aidl
@@ -123,6 +123,9 @@
/**
* Transmits an APDU command (as per ISO/IEC 7816) to the SE.
*
+ * @throws ServiceSpecificException with code CHANNEL_NOT_AVAILABLE
+ * if there was an error in communicating with the secure element.
+ *
* @param data APDU command to be sent
* @return response to the command
*/
diff --git a/secure_element/aidl/vts/VtsHalSecureElementTargetTest.cpp b/secure_element/aidl/vts/VtsHalSecureElementTargetTest.cpp
index 2e96f7d..0925a21 100644
--- a/secure_element/aidl/vts/VtsHalSecureElementTargetTest.cpp
+++ b/secure_element/aidl/vts/VtsHalSecureElementTargetTest.cpp
@@ -136,18 +136,27 @@
apdu[0] |= (channel_number - 4) | 0x40;
}
- EXPECT_OK(secure_element_->transmit(apdu, &response));
+ // transmit() will return an empty response with the error
+ // code CHANNEL_NOT_AVAILABLE when the SE cannot be
+ // communicated with.
+ auto status = secure_element_->transmit(apdu, &response);
+ if (!status.isOk()) {
+ return 0x6881;
+ }
+
+ // transmit() will return a response containing at least
+ // the APDU response status otherwise.
EXPECT_GE(response.size(), 2u);
- uint16_t status =
+ uint16_t apdu_status =
(response[response.size() - 2] << 8) | (response[response.size() - 1] << 0);
// When the command is successful the response
// must contain 256 bytes of data.
- if (status == 0x9000) {
+ if (apdu_status == 0x9000) {
EXPECT_EQ(response.size(), 258);
}
- return status;
+ return apdu_status;
}
std::shared_ptr<ISecureElement> secure_element_;
diff --git a/security/keymint/aidl/vts/performance/KeyMintBenchmark.cpp b/security/keymint/aidl/vts/performance/KeyMintBenchmark.cpp
index 0c61c25..49fd0c9 100644
--- a/security/keymint/aidl/vts/performance/KeyMintBenchmark.cpp
+++ b/security/keymint/aidl/vts/performance/KeyMintBenchmark.cpp
@@ -68,7 +68,7 @@
int getError() { return static_cast<int>(error_); }
- const string& GenerateMessage(int size) {
+ const string GenerateMessage(int size) {
for (const string& message : message_cache_) {
if (message.size() == size) {
return message;
@@ -76,7 +76,7 @@
}
string message = string(size, 'x');
message_cache_.push_back(message);
- return std::move(message);
+ return message;
}
optional<BlockMode> getBlockMode(string transform) {
diff --git a/sensors/1.0/vts/functional/SensorsHidlEnvironmentV1_0.h b/sensors/1.0/vts/functional/SensorsHidlEnvironmentV1_0.h
index b802e6c..a4e4457 100644
--- a/sensors/1.0/vts/functional/SensorsHidlEnvironmentV1_0.h
+++ b/sensors/1.0/vts/functional/SensorsHidlEnvironmentV1_0.h
@@ -46,8 +46,6 @@
bool resetHal() override;
void startPollingThread() override;
static void pollingThread(SensorsHidlEnvironmentV1_0* env, std::atomic_bool& stop);
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(SensorsHidlEnvironmentV1_0);
};
#endif // ANDROID_SENSORS_HIDL_ENVIRONMENT_V1_0_H
\ No newline at end of file
diff --git a/sensors/aidl/vts/SensorsAidlEnvironment.h b/sensors/aidl/vts/SensorsAidlEnvironment.h
index 2f5f287..a852e91 100644
--- a/sensors/aidl/vts/SensorsAidlEnvironment.h
+++ b/sensors/aidl/vts/SensorsAidlEnvironment.h
@@ -69,8 +69,6 @@
*/
void readEvents();
- GTEST_DISALLOW_COPY_AND_ASSIGN_(SensorsAidlEnvironment);
-
/**
* Pointer to the Sensors HAL Interface that allows the test to call HAL functions.
*/
diff --git a/sensors/common/vts/2_X/SensorsHidlEnvironmentV2_X.h b/sensors/common/vts/2_X/SensorsHidlEnvironmentV2_X.h
index 5fe4d8b..796de2f 100644
--- a/sensors/common/vts/2_X/SensorsHidlEnvironmentV2_X.h
+++ b/sensors/common/vts/2_X/SensorsHidlEnvironmentV2_X.h
@@ -79,8 +79,6 @@
*/
void readEvents();
- GTEST_DISALLOW_COPY_AND_ASSIGN_(SensorsHidlEnvironmentV2_X);
-
/**
* Pointer to the Sensors HAL Interface that allows the test to call HAL functions.
*/
diff --git a/sensors/common/vts/utils/include/sensors-vts-utils/SensorsVtsEnvironmentBase.h b/sensors/common/vts/utils/include/sensors-vts-utils/SensorsVtsEnvironmentBase.h
index 17a96ed..e851d40 100644
--- a/sensors/common/vts/utils/include/sensors-vts-utils/SensorsVtsEnvironmentBase.h
+++ b/sensors/common/vts/utils/include/sensors-vts-utils/SensorsVtsEnvironmentBase.h
@@ -115,6 +115,8 @@
: mCollectionEnabled(false), mCallback(nullptr) {
mServiceName = service_name;
}
+ SensorsVtsEnvironmentBase(const SensorsVtsEnvironmentBase&) = delete;
+ SensorsVtsEnvironmentBase& operator=(const SensorsVtsEnvironmentBase&) = delete;
virtual ~SensorsVtsEnvironmentBase(){};
void addEvent(const Event& ev) {
@@ -139,8 +141,6 @@
std::mutex mEventsMutex;
IEventCallback<Event>* mCallback;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(SensorsVtsEnvironmentBase<Event>);
};
#endif // ANDROID_SENSORS_VTS_ENVIRONMENT_BASE_H
\ No newline at end of file
diff --git a/tv/tuner/1.0/default/Dvr.cpp b/tv/tuner/1.0/default/Dvr.cpp
index 40879f2..9d6d86d 100644
--- a/tv/tuner/1.0/default/Dvr.cpp
+++ b/tv/tuner/1.0/default/Dvr.cpp
@@ -164,7 +164,7 @@
return false;
}
- mDvrMQ = move(tmpDvrMQ);
+ mDvrMQ = std::move(tmpDvrMQ);
if (EventFlag::createEventFlag(mDvrMQ->getEventFlagWord(), &mDvrEventFlag) != OK) {
return false;
diff --git a/tv/tuner/1.1/default/Dvr.cpp b/tv/tuner/1.1/default/Dvr.cpp
index fdb66c1..8262b4d 100644
--- a/tv/tuner/1.1/default/Dvr.cpp
+++ b/tv/tuner/1.1/default/Dvr.cpp
@@ -183,7 +183,7 @@
return false;
}
- mDvrMQ = move(tmpDvrMQ);
+ mDvrMQ = std::move(tmpDvrMQ);
if (EventFlag::createEventFlag(mDvrMQ->getEventFlagWord(), &mDvrEventFlag) != OK) {
return false;
diff --git a/usb/gadget/1.1/default/lib/MonitorFfs.cpp b/usb/gadget/1.1/default/lib/MonitorFfs.cpp
index 0cdf038..6d09a8a 100644
--- a/usb/gadget/1.1/default/lib/MonitorFfs.cpp
+++ b/usb/gadget/1.1/default/lib/MonitorFfs.cpp
@@ -59,9 +59,9 @@
if (addEpollFd(epollFd, eventFd) == -1) abort();
- mEpollFd = move(epollFd);
- mInotifyFd = move(inotifyFd);
- mEventFd = move(eventFd);
+ mEpollFd = std::move(epollFd);
+ mInotifyFd = std::move(inotifyFd);
+ mEventFd = std::move(eventFd);
gadgetPullup = false;
}
diff --git a/usb/gadget/1.2/default/lib/MonitorFfs.cpp b/usb/gadget/1.2/default/lib/MonitorFfs.cpp
index 0cdf038..6d09a8a 100644
--- a/usb/gadget/1.2/default/lib/MonitorFfs.cpp
+++ b/usb/gadget/1.2/default/lib/MonitorFfs.cpp
@@ -59,9 +59,9 @@
if (addEpollFd(epollFd, eventFd) == -1) abort();
- mEpollFd = move(epollFd);
- mInotifyFd = move(inotifyFd);
- mEventFd = move(eventFd);
+ mEpollFd = std::move(epollFd);
+ mInotifyFd = std::move(inotifyFd);
+ mEventFd = std::move(eventFd);
gadgetPullup = false;
}
diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorReasonCodes.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorReasonCodes.aidl
index dc2252b..d1f1256 100644
--- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorReasonCodes.aidl
+++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorReasonCodes.aidl
@@ -35,4 +35,5 @@
@Backing(type="int") @VintfStability
enum UwbVendorReasonCodes {
REASON_ERROR_INVALID_CHANNEL_WITH_AOA = 128,
+ REASON_REGULATION_UWB_OFF = 129,
}
diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorStatusCodes.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorStatusCodes.aidl
index 2f534df..768ef8c 100644
--- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorStatusCodes.aidl
+++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorStatusCodes.aidl
@@ -36,4 +36,5 @@
enum UwbVendorStatusCodes {
STATUS_ERROR_CCC_SE_BUSY = 80,
STATUS_ERROR_CCC_LIFECYCLE = 81,
+ STATUS_REGULATION_UWB_OFF = 82,
}
diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorReasonCodes.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorReasonCodes.aidl
index ae203a3..a64a188 100644
--- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorReasonCodes.aidl
+++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorReasonCodes.aidl
@@ -24,11 +24,13 @@
@Backing(type="int")
enum UwbVendorReasonCodes {
/**
- * Use values from the vendor specific reason code range: 0x80 – 0xFF defined in Table 16 of
- * UCI specification.
+ * Use values from the vendor specific reason code range: 0x80 – 0xFF defined in
+ * Table 15 (state change with reason codes) of UCI specification.
*/
/** Fira specific */
/** The channel requested is not available for AoA */
REASON_ERROR_INVALID_CHANNEL_WITH_AOA = 0x80,
+ /** UWB has been disabled (eg: country code change leads to UWB unsupported) */
+ REASON_REGULATION_UWB_OFF = 0x81,
}
diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorStatusCodes.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorStatusCodes.aidl
index 8505b8a..f1eea9d 100644
--- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorStatusCodes.aidl
+++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorStatusCodes.aidl
@@ -33,4 +33,6 @@
STATUS_ERROR_CCC_SE_BUSY = 0x50,
/** CCC Lifecycle error */
STATUS_ERROR_CCC_LIFECYCLE = 0x51,
+ /** UWB Regulation Off */
+ STATUS_REGULATION_UWB_OFF = 0x52,
}
diff --git a/vibrator/OWNERS b/vibrator/OWNERS
index 05e2e73..62a567e 100644
--- a/vibrator/OWNERS
+++ b/vibrator/OWNERS
@@ -2,7 +2,6 @@
include platform/frameworks/base:/services/core/java/com/android/server/vibrator/OWNERS
-chasewu@google.com
chrispaulo@google.com
michaelwr@google.com
nathankulczak@google.com
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiChip.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiChip.aidl
index b27b06f..23f4030 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiChip.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiChip.aidl
@@ -47,7 +47,7 @@
@PropagateAllowBlocking android.hardware.wifi.IWifiApIface getApIface(in String ifname);
String[] getApIfaceNames();
android.hardware.wifi.IWifiChip.ChipMode[] getAvailableModes();
- android.hardware.wifi.IWifiChip.ChipCapabilityMask getCapabilities();
+ int getCapabilities();
android.hardware.wifi.WifiDebugHostWakeReasonStats getDebugHostWakeReasonStats();
android.hardware.wifi.WifiDebugRingBufferStatus[] getDebugRingBuffersStatus();
int getId();
@@ -58,9 +58,9 @@
String[] getP2pIfaceNames();
@PropagateAllowBlocking android.hardware.wifi.IWifiStaIface getStaIface(in String ifname);
String[] getStaIfaceNames();
- android.hardware.wifi.WifiRadioCombinationMatrix getSupportedRadioCombinationsMatrix();
+ android.hardware.wifi.WifiRadioCombination[] getSupportedRadioCombinations();
android.hardware.wifi.WifiChipCapabilities getWifiChipCapabilities();
- android.hardware.wifi.WifiUsableChannel[] getUsableChannels(in android.hardware.wifi.WifiBand band, in android.hardware.wifi.WifiIfaceMode ifaceModeMask, in android.hardware.wifi.IWifiChip.UsableChannelFilter filterMask);
+ android.hardware.wifi.WifiUsableChannel[] getUsableChannels(in android.hardware.wifi.WifiBand band, in int ifaceModeMask, in int filterMask);
void setAfcChannelAllowance(in android.hardware.wifi.AvailableAfcFrequencyInfo[] availableAfcFrequencyInfo);
void registerEventCallback(in android.hardware.wifi.IWifiChipEventCallback callback);
void removeApIface(in String ifname);
@@ -73,7 +73,7 @@
byte[] requestFirmwareDebugDump();
void resetTxPowerScenario();
void selectTxPowerScenario(in android.hardware.wifi.IWifiChip.TxPowerScenario scenario);
- void setCoexUnsafeChannels(in android.hardware.wifi.IWifiChip.CoexUnsafeChannel[] unsafeChannels, in android.hardware.wifi.IWifiChip.CoexRestriction restrictions);
+ void setCoexUnsafeChannels(in android.hardware.wifi.IWifiChip.CoexUnsafeChannel[] unsafeChannels, in int restrictions);
void setCountryCode(in byte[2] code);
void setLatencyMode(in android.hardware.wifi.IWifiChip.LatencyMode mode);
void setMultiStaPrimaryConnection(in String ifName);
@@ -81,7 +81,7 @@
void startLoggingToDebugRingBuffer(in String ringName, in android.hardware.wifi.WifiDebugRingBufferVerboseLevel verboseLevel, in int maxIntervalInSec, in int minDataSizeInBytes);
void stopLoggingToDebugRingBuffer();
void triggerSubsystemRestart();
- void enableStaChannelForPeerNetwork(in android.hardware.wifi.IWifiChip.ChannelCategoryMask channelCategoryEnableFlag);
+ void enableStaChannelForPeerNetwork(in int channelCategoryEnableFlag);
void setMloMode(in android.hardware.wifi.IWifiChip.ChipMloMode mode);
const int NO_POWER_CAP_CONSTANT = 0x7FFFFFFF;
@Backing(type="int") @VintfStability
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl
index 31b6881..a7f2081 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl
@@ -41,7 +41,7 @@
void enableNdOffload(in boolean enable);
android.hardware.wifi.StaApfPacketFilterCapabilities getApfPacketFilterCapabilities();
android.hardware.wifi.StaBackgroundScanCapabilities getBackgroundScanCapabilities();
- android.hardware.wifi.IWifiStaIface.StaIfaceCapabilityMask getCapabilities();
+ int getCapabilities();
android.hardware.wifi.WifiDebugRxPacketFateReport[] getDebugRxPacketFates();
android.hardware.wifi.WifiDebugTxPacketFateReport[] getDebugTxPacketFates();
byte[6] getFactoryMacAddress();
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCapabilities.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCapabilities.aidl
index bb44679..a30893a 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCapabilities.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCapabilities.aidl
@@ -47,7 +47,7 @@
int maxAppInfoLen;
int maxQueuedTransmitFollowupMsgs;
int maxSubscribeInterfaceAddresses;
- android.hardware.wifi.NanCipherSuiteType supportedCipherSuites;
+ int supportedCipherSuites;
boolean instantCommunicationModeSupportFlag;
boolean supports6g;
boolean supportsHe;
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCipherSuiteType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCipherSuiteType.aidl
index d1149c4..6f3158e 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCipherSuiteType.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCipherSuiteType.aidl
@@ -39,6 +39,6 @@
SHARED_KEY_256_MASK = (1 << 1) /* 2 */,
PUBLIC_KEY_2WDH_128_MASK = (1 << 2) /* 4 */,
PUBLIC_KEY_2WDH_256_MASK = (1 << 3) /* 8 */,
- PUBLIC_KEY_PASN_128_MASK = (1 << 4) /* 16 */,
- PUBLIC_KEY_PASN_256_MASK = (1 << 5) /* 32 */,
+ PUBLIC_KEY_PASN_128_MASK = (1 << 6) /* 64 */,
+ PUBLIC_KEY_PASN_256_MASK = (1 << 7) /* 128 */,
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDiscoveryCommonConfig.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDiscoveryCommonConfig.aidl
index e84cabf..96d940a 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDiscoveryCommonConfig.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDiscoveryCommonConfig.aidl
@@ -51,7 +51,7 @@
android.hardware.wifi.NanDataPathSecurityConfig securityConfig;
boolean rangingRequired;
int rangingIntervalMs;
- android.hardware.wifi.NanRangingIndication configRangingIndications;
+ int configRangingIndications;
char distanceIngressCm;
char distanceEgressCm;
boolean enableSessionSuspendability;
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanMatchInd.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanMatchInd.aidl
index 6757bec..317489f 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanMatchInd.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanMatchInd.aidl
@@ -47,7 +47,7 @@
boolean peerRequiresSecurityEnabledInNdp;
boolean peerRequiresRanging;
int rangingMeasurementInMm;
- android.hardware.wifi.NanRangingIndication rangingIndicationType;
+ int rangingIndicationType;
byte[] scid;
android.hardware.wifi.NanPairingConfig peerPairingConfig;
android.hardware.wifi.NanIdentityResolutionAttribute peerNira;
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaBackgroundScanBucketParameters.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaBackgroundScanBucketParameters.aidl
index b49d406..4e9671a 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaBackgroundScanBucketParameters.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaBackgroundScanBucketParameters.aidl
@@ -38,7 +38,7 @@
android.hardware.wifi.WifiBand band;
int[] frequencies;
int periodInMs;
- android.hardware.wifi.StaBackgroundScanBucketEventReportSchemeMask eventReportScheme;
+ int eventReportScheme;
int exponentialMaxPeriodInMs;
int exponentialBase;
int exponentialStepCount;
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaScanData.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaScanData.aidl
index 5903760..7c75232 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaScanData.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaScanData.aidl
@@ -34,7 +34,7 @@
package android.hardware.wifi;
@VintfStability
parcelable StaScanData {
- android.hardware.wifi.StaScanDataFlagMask flags;
+ int flags;
int bucketsScanned;
android.hardware.wifi.StaScanResult[] results;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiUsableChannel.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiUsableChannel.aidl
index 94e3a8a..774b242 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiUsableChannel.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiUsableChannel.aidl
@@ -36,5 +36,5 @@
parcelable WifiUsableChannel {
int channel;
android.hardware.wifi.WifiChannelWidthInMhz channelBandwidth;
- android.hardware.wifi.WifiIfaceMode ifaceModeMask;
+ int ifaceModeMask;
}
diff --git a/wifi/aidl/android/hardware/wifi/IWifiChip.aidl b/wifi/aidl/android/hardware/wifi/IWifiChip.aidl
index de2449e..1710f63 100644
--- a/wifi/aidl/android/hardware/wifi/IWifiChip.aidl
+++ b/wifi/aidl/android/hardware/wifi/IWifiChip.aidl
@@ -31,7 +31,7 @@
import android.hardware.wifi.WifiDebugRingBufferStatus;
import android.hardware.wifi.WifiDebugRingBufferVerboseLevel;
import android.hardware.wifi.WifiIfaceMode;
-import android.hardware.wifi.WifiRadioCombinationMatrix;
+import android.hardware.wifi.WifiRadioCombination;
import android.hardware.wifi.WifiUsableChannel;
/**
@@ -590,7 +590,7 @@
* |WifiStatusCode.ERROR_NOT_AVAILABLE|,
* |WifiStatusCode.ERROR_UNKNOWN|
*/
- ChipCapabilityMask getCapabilities();
+ int getCapabilities();
/**
* API to retrieve the wifi wake up reason stats for debugging.
@@ -737,8 +737,7 @@
* Retrieve the list of all the possible radio combinations supported by this
* chip.
*
- * @return A list of all the possible radio combinations represented by
- * |WifiRadioCombinationMatrix|.
+ * @return A list of all the possible radio combinations.
* For example, in case of a chip which has two radios, where one radio is
* capable of 2.4GHz 2X2 only and another radio which is capable of either
* 5GHz or 6GHz 2X2, the number of possible radio combinations in this case
@@ -759,7 +758,7 @@
* |WifiStatusCode.FAILURE_UNKNOWN|
*
*/
- WifiRadioCombinationMatrix getSupportedRadioCombinationsMatrix();
+ WifiRadioCombination[] getSupportedRadioCombinations();
/**
* Get capabilities supported by this chip.
@@ -809,7 +808,7 @@
* |WifiStatusCode.FAILURE_UNKNOWN|
*/
WifiUsableChannel[] getUsableChannels(
- in WifiBand band, in WifiIfaceMode ifaceModeMask, in UsableChannelFilter filterMask);
+ in WifiBand band, in int ifaceModeMask, in int filterMask);
/*
* Set the max power level the chip is allowed to transmit on for 6Ghz AFC
@@ -983,8 +982,7 @@
* |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
* |WifiStatusCode.ERROR_INVALID_ARGS|,
*/
- void setCoexUnsafeChannels(
- in CoexUnsafeChannel[] unsafeChannels, in CoexRestriction restrictions);
+ void setCoexUnsafeChannels(in CoexUnsafeChannel[] unsafeChannels, in int restrictions);
/**
* Set country code for this Wifi chip.
@@ -1111,14 +1109,14 @@
* If the channel category is enabled and allowed by the regulatory, the HAL method
* getUsableChannels() will contain the current STA-connected channel if that channel belongs
* to that category.
- * @param channelCategoryEnableFlag bitmask of |ChannelCategoryMask|.
+ * @param channelCategoryEnableFlag Bitmask of |ChannelCategoryMask| values.
* For each bit, 1 enables the channel category and 0 disables that channel category.
* @throws ServiceSpecificException with one of the following values:
* |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
* |WifiStatusCode.ERROR_NOT_SUPPORTED|,
* |WifiStatusCode.FAILURE_UNKNOWN|
*/
- void enableStaChannelForPeerNetwork(in ChannelCategoryMask channelCategoryEnableFlag);
+ void enableStaChannelForPeerNetwork(in int channelCategoryEnableFlag);
/**
* Multi-Link Operation modes.
diff --git a/wifi/aidl/android/hardware/wifi/IWifiNanIface.aidl b/wifi/aidl/android/hardware/wifi/IWifiNanIface.aidl
index 5f3ce6c..3ce8d02 100644
--- a/wifi/aidl/android/hardware/wifi/IWifiNanIface.aidl
+++ b/wifi/aidl/android/hardware/wifi/IWifiNanIface.aidl
@@ -79,6 +79,7 @@
* Asynchronous response is with |IWifiNanIfaceEventCallback.notifyCreateDataInterfaceResponse|.
*
* @param cmdId Command Id to use for this invocation.
+ * @param ifaceName The name of the interface, e.g. "aware0".
* @throws ServiceSpecificException with one of the following values:
* |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
* |WifiStatusCode.ERROR_UNKNOWN|
@@ -90,6 +91,7 @@
* Asynchronous response is with |IWifiNanIfaceEventCallback.notifyDeleteDataInterfaceResponse|.
*
* @param cmdId Command Id to use for this invocation.
+ * @param ifaceName The name of the interface, e.g. "aware0".
* @throws ServiceSpecificException with one of the following values:
* |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
* |WifiStatusCode.ERROR_UNKNOWN|
diff --git a/wifi/aidl/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl b/wifi/aidl/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl
index 8a61a9c..3649b7b 100644
--- a/wifi/aidl/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl
+++ b/wifi/aidl/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl
@@ -132,7 +132,7 @@
/**
* Callback providing status on a completed followup message transmit operation.
*
- * @param cmdId Command Id corresponding to the original |transmitFollowupRequest| request.
+ * @param id Command ID corresponding to the original |transmitFollowupRequest| request.
* @param status NanStatus of the operation. Possible status codes are:
* |NanStatusCode.SUCCESS|
* |NanStatusCode.NO_OTA_ACK|
@@ -151,7 +151,7 @@
* Callback invoked in response to a capability request
* |IWifiNanIface.getCapabilitiesRequest|.
*
- * @param cmdId Command Id corresponding to the original request.
+ * @param id Command ID corresponding to the original request.
* @param status NanStatus of the operation. Possible status codes are:
* |NanStatusCode.SUCCESS|
* @param capabilities Capability data.
@@ -162,7 +162,7 @@
/**
* Callback invoked in response to a config request |IWifiNanIface.configRequest|.
*
- * @param cmdId Command Id corresponding to the original request.
+ * @param id Command ID corresponding to the original request.
* @param status NanStatus of the operation. Possible status codes are:
* |NanStatusCode.SUCCESS|
* |NanStatusCode.INVALID_ARGS|
@@ -175,7 +175,7 @@
* Callback invoked in response to a create data interface request
* |IWifiNanIface.createDataInterfaceRequest|.
*
- * @param cmdId Command Id corresponding to the original request.
+ * @param id Command ID corresponding to the original request.
* @param status NanStatus of the operation. Possible status codes are:
* |NanStatusCode.SUCCESS|
* |NanStatusCode.INVALID_ARGS|
@@ -187,7 +187,7 @@
* Callback invoked in response to a delete data interface request
* |IWifiNanIface.deleteDataInterfaceRequest|.
*
- * @param cmdId Command Id corresponding to the original request.
+ * @param id Command ID corresponding to the original request.
* @param status NanStatus of the operation. Possible status codes are:
* |NanStatusCode.SUCCESS|
* |NanStatusCode.INVALID_ARGS|
@@ -198,7 +198,7 @@
/**
* Callback invoked in response to a disable request |IWifiNanIface.disableRequest|.
*
- * @param cmdId Command Id corresponding to the original request.
+ * @param id Command ID corresponding to the original request.
* @param status NanStatus of the operation. Possible status codes are:
* |NanStatusCode.SUCCESS|
* |NanStatusCode.PROTOCOL_FAILURE|
@@ -208,7 +208,7 @@
/**
* Callback invoked in response to an enable request |IWifiNanIface.enableRequest|.
*
- * @param cmdId Command Id corresponding to the original request.
+ * @param id Command ID corresponding to the original request.
* @param status NanStatus of the operation. Possible status codes are:
* |NanStatusCode.SUCCESS|
* |NanStatusCode.ALREADY_ENABLED|
@@ -223,7 +223,7 @@
* Callback invoked in response to an initiate data path request
* |IWifiNanIface.initiateDataPathRequest|.
*
- * @param cmdId Command Id corresponding to the original request.
+ * @param id Command ID corresponding to the original request.
* @param status NanStatus of the operation. Possible status codes are:
* |NanStatusCode.SUCCESS|
* |NanStatusCode.INVALID_ARGS|
@@ -238,7 +238,7 @@
* Callback invoked in response to a respond to data path indication request
* |IWifiNanIface.respondToDataPathIndicationRequest|.
*
- * @param cmdId Command Id corresponding to the original request.
+ * @param id Command ID corresponding to the original request.
* @param status NanStatus of the operation. Possible status codes are:
* |NanStatusCode.SUCCESS|
* |NanStatusCode.INVALID_ARGS|
@@ -252,7 +252,7 @@
* Callback invoked to notify the status of the start publish request
* |IWifiNanIface.startPublishRequest|.
*
- * @param cmdId Command Id corresponding to the original request.
+ * @param id Command ID corresponding to the original request.
* @param status NanStatus of the operation. Possible status codes are:
* |NanStatusCode.SUCCESS|
* |NanStatusCode.INVALID_ARGS|
@@ -267,7 +267,7 @@
* Callback invoked to notify the status of the start subscribe request
* |IWifiNanIface.startSubscribeRequest|.
*
- * @param cmdId Command Id corresponding to the original request.
+ * @param id Command ID corresponding to the original request.
* @param status NanStatus of the operation. Possible status codes are:
* |NanStatusCode.SUCCESS|
* |NanStatusCode.INVALID_ARGS|
@@ -282,7 +282,7 @@
* Callback invoked in response to a stop publish request
* |IWifiNanIface.stopPublishRequest|.
*
- * @param cmdId Command Id corresponding to the original request.
+ * @param id Command ID corresponding to the original request.
* @param status NanStatus of the operation. Possible status codes are:
* |NanStatusCode.SUCCESS|
* |NanStatusCode.INVALID_SESSION_ID|
@@ -294,7 +294,7 @@
* Callback invoked in response to a stop subscribe request
* |IWifiNanIface.stopSubscribeRequest|.
*
- * @param cmdId Command Id corresponding to the original request.
+ * @param id Command ID corresponding to the original request.
* @param status NanStatus of the operation. Possible status codes are:
* |NanStatusCode.SUCCESS|
* |NanStatusCode.INVALID_SESSION_ID|
@@ -306,7 +306,7 @@
* Callback invoked in response to a terminate data path request
* |IWifiNanIface.terminateDataPathRequest|.
*
- * @param cmdId Command Id corresponding to the original request.
+ * @param id Command ID corresponding to the original request.
* @param status NanStatus of the operation. Possible status codes are:
* |NanStatusCode.SUCCESS|
* |NanStatusCode.INVALID_ARGS|
@@ -320,7 +320,7 @@
* Callback invoked in response to a suspension request
* |IWifiNanIface.suspendRequest|.
*
- * @param cmdId Command Id corresponding to the original request.
+ * @param id Command ID corresponding to the original request.
* @param status NanStatus of the operation. Possible status codes are:
* |NanStatusCode.SUCCESS|
* |NanStatusCode.INVALID_SESSION_ID|
@@ -333,7 +333,7 @@
* Callback invoked in response to a resume request
* |IWifiNanIface.resumeRequest|.
*
- * @param cmdId Command Id corresponding to the original request.
+ * @param id Command ID corresponding to the original request.
* @param status NanStatus of the operation. Possible status codes are:
* |NanStatusCode.SUCCESS|
* |NanStatusCode.INVALID_SESSION_ID|
@@ -346,7 +346,7 @@
* Callback invoked in response to a transmit followup request
* |IWifiNanIface.transmitFollowupRequest|.
*
- * @param cmdId Command Id corresponding to the original request.
+ * @param id Command ID corresponding to the original request.
* @param status NanStatus of the operation. Possible status codes are:
* |NanStatusCode.SUCCESS|
* |NanStatusCode.INVALID_ARGS|
@@ -377,7 +377,7 @@
* Callback invoked in response to an initiate NAN pairing request
* |IWifiNanIface.initiatePairingRequest|.
*
- * @param cmdId Command Id corresponding to the original request.
+ * @param id Command ID corresponding to the original request.
* @param status NanStatus of the operation. Possible status codes are:
* |NanStatusCode.SUCCESS|
* |NanStatusCode.INVALID_ARGS|
@@ -392,7 +392,7 @@
* Callback invoked in response to a respond to NAN pairing indication request
* |IWifiNanIface.respondToPairingIndicationRequest|.
*
- * @param cmdId Command Id corresponding to the original request.
+ * @param id Command ID corresponding to the original request.
* @param status NanStatus of the operation. Possible status codes are:
* |NanStatusCode.SUCCESS|
* |NanStatusCode.INVALID_ARGS|
@@ -422,7 +422,7 @@
* Callback invoked in response to an initiate NAN pairing bootstrapping request
* |IWifiNanIface.initiateBootstrappingRequest|.
*
- * @param cmdId Command Id corresponding to the original request.
+ * @param id Command ID corresponding to the original request.
* @param status NanStatus of the operation. Possible status codes are:
* |NanStatusCode.SUCCESS|
* |NanStatusCode.INVALID_ARGS|
@@ -438,7 +438,7 @@
* Callback invoked in response to a respond to pairing bootstrapping indication request
* |IWifiNanIface.respondToBootstrappingIndicationRequest|.
*
- * @param cmdId Command Id corresponding to the original request.
+ * @param id Command ID corresponding to the original request.
* @param status NanStatus of the operation. Possible status codes are:
* |NanStatusCode.SUCCESS|
* |NanStatusCode.INVALID_ARGS|
diff --git a/wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl b/wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl
index 28d6a4d..8e9a06d 100644
--- a/wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl
+++ b/wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl
@@ -198,7 +198,7 @@
* |WifiStatusCode.ERROR_NOT_AVAILABLE|,
* |WifiStatusCode.ERROR_UNKNOWN|
*/
- StaIfaceCapabilityMask getCapabilities();
+ int getCapabilities();
/**
* API to retrieve the fates of inbound packets.
diff --git a/wifi/aidl/android/hardware/wifi/NanBootstrappingConfirmInd.aidl b/wifi/aidl/android/hardware/wifi/NanBootstrappingConfirmInd.aidl
index 7d7a436..e72c940 100644
--- a/wifi/aidl/android/hardware/wifi/NanBootstrappingConfirmInd.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanBootstrappingConfirmInd.aidl
@@ -16,10 +16,12 @@
package android.hardware.wifi;
-import android.hardware.wifi.NanBootstrappingMethod;
import android.hardware.wifi.NanBootstrappingResponseCode;
import android.hardware.wifi.NanStatus;
+/**
+ * See Wi-Fi Aware R4.0 section 9.5.21.7
+ */
@VintfStability
parcelable NanBootstrappingConfirmInd {
/**
@@ -44,7 +46,7 @@
int comeBackDelay;
/**
- * Cookie received from the comeback response.
+ * Cookie received from peer with |comeBackDelay| for follow up |NanBootstrappingRequest|
*/
byte[] cookie;
}
diff --git a/wifi/aidl/android/hardware/wifi/NanBootstrappingMethod.aidl b/wifi/aidl/android/hardware/wifi/NanBootstrappingMethod.aidl
index 8960794..da2ff25 100644
--- a/wifi/aidl/android/hardware/wifi/NanBootstrappingMethod.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanBootstrappingMethod.aidl
@@ -17,7 +17,8 @@
package android.hardware.wifi;
/**
- * Pairing bootstrapping method flag
+ * Pairing bootstrapping method flag.
+ * See Wi-Fi Aware R4.0 section 9.5.21.7 table 128
*/
@VintfStability
@Backing(type="int")
diff --git a/wifi/aidl/android/hardware/wifi/NanBootstrappingRequest.aidl b/wifi/aidl/android/hardware/wifi/NanBootstrappingRequest.aidl
index 5297b9f..4b74cd9 100644
--- a/wifi/aidl/android/hardware/wifi/NanBootstrappingRequest.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanBootstrappingRequest.aidl
@@ -18,6 +18,9 @@
import android.hardware.wifi.NanBootstrappingMethod;
+/**
+ * See Wi-Fi Aware R4.0 section 9.5.21.7
+ */
@VintfStability
parcelable NanBootstrappingRequest {
/**
@@ -34,12 +37,12 @@
byte[6] peerDiscMacAddr;
/**
- * Bootstrapping method in the request, one of the |NanBootstrappingMethod|
+ * One of |NanBootstrappingMethod| indicating the bootstrapping method in the request.
*/
NanBootstrappingMethod requestBootstrappingMethod;
/**
- * Cookie for the follow up request
+ * Cookie received from previous |NanBootstrappingConfirmInd| for comeback request.
*/
byte[] cookie;
}
diff --git a/wifi/aidl/android/hardware/wifi/NanBootstrappingRequestInd.aidl b/wifi/aidl/android/hardware/wifi/NanBootstrappingRequestInd.aidl
index e11122f..6f43892 100644
--- a/wifi/aidl/android/hardware/wifi/NanBootstrappingRequestInd.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanBootstrappingRequestInd.aidl
@@ -21,7 +21,7 @@
/**
* NAN Data path request indication message structure.
* Event indication received by an intended Responder when a NAN
- * data request initiated by an Initiator.
+ * data request is initiated by an Initiator. See Wi-Fi Aware R4.0 section 9.5.21.7
*/
@VintfStability
parcelable NanBootstrappingRequestInd {
@@ -48,7 +48,7 @@
int bootstrappingInstanceId;
/**
- * Bootstrapping method in the incoming request, one of the |NanBootstrappingMethod|
+ * One of |NanBootstrappingMethod| indicating the bootstrapping method in the incoming request.
*/
NanBootstrappingMethod requestBootstrappingMethod;
}
diff --git a/wifi/aidl/android/hardware/wifi/NanBootstrappingResponse.aidl b/wifi/aidl/android/hardware/wifi/NanBootstrappingResponse.aidl
index 0a7d621..dbe8923 100644
--- a/wifi/aidl/android/hardware/wifi/NanBootstrappingResponse.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanBootstrappingResponse.aidl
@@ -16,8 +16,9 @@
package android.hardware.wifi;
-import android.hardware.wifi.NanBootstrappingMethod;
-
+/**
+ * See Wi-Fi Aware R4.0 section 9.5.21.7
+ */
@VintfStability
parcelable NanBootstrappingResponse {
/**
diff --git a/wifi/aidl/android/hardware/wifi/NanCapabilities.aidl b/wifi/aidl/android/hardware/wifi/NanCapabilities.aidl
index c1d6201..f581c5e 100644
--- a/wifi/aidl/android/hardware/wifi/NanCapabilities.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanCapabilities.aidl
@@ -16,8 +16,6 @@
package android.hardware.wifi;
-import android.hardware.wifi.NanCipherSuiteType;
-
/**
* NDP Capabilities response.
*/
@@ -78,9 +76,9 @@
*/
int maxSubscribeInterfaceAddresses;
/**
- * The set of supported Cipher suites. The |NanCipherSuiteType| bit fields are used.
+ * Bitmap of |NanCipherSuiteType| values indicating the set of supported cipher suites.
*/
- NanCipherSuiteType supportedCipherSuites;
+ int supportedCipherSuites;
/**
* Flag to indicate if instant communication mode is supported.
*/
diff --git a/wifi/aidl/android/hardware/wifi/NanCipherSuiteType.aidl b/wifi/aidl/android/hardware/wifi/NanCipherSuiteType.aidl
index 0d2fc99..91b5caf 100644
--- a/wifi/aidl/android/hardware/wifi/NanCipherSuiteType.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanCipherSuiteType.aidl
@@ -17,13 +17,19 @@
package android.hardware.wifi;
/**
- * Cipher suite flags. Wi-Fi Aware Specification 4.0 section 7.1.2
+ * Cipher suite flags. Wi-Fi Aware Specification 4.0 section 9.5.21.1.
*/
@VintfStability
@Backing(type="int")
enum NanCipherSuiteType {
NONE = 0,
+ /**
+ * NCS-SK-128
+ */
SHARED_KEY_128_MASK = 1 << 0,
+ /**
+ * NCS-SK-256
+ */
SHARED_KEY_256_MASK = 1 << 1,
/**
* NCS-PK-2WDH-128
@@ -34,11 +40,15 @@
*/
PUBLIC_KEY_2WDH_256_MASK = 1 << 3,
/**
+ * bit 4 and bit 5 are reserved for NCS-GTK-CCMP-128 and NCS-GTK-CCMP-256. Which are not used
+ * from framework
+ */
+ /**
* NCS-PK-PASN-128
*/
- PUBLIC_KEY_PASN_128_MASK = 1 << 4,
+ PUBLIC_KEY_PASN_128_MASK = 1 << 6,
/**
* NCS-PK-PASN-256
*/
- PUBLIC_KEY_PASN_256_MASK = 1 << 5,
+ PUBLIC_KEY_PASN_256_MASK = 1 << 7,
}
diff --git a/wifi/aidl/android/hardware/wifi/NanDataPathSecurityConfig.aidl b/wifi/aidl/android/hardware/wifi/NanDataPathSecurityConfig.aidl
index 42a5616..9a2013b 100644
--- a/wifi/aidl/android/hardware/wifi/NanDataPathSecurityConfig.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanDataPathSecurityConfig.aidl
@@ -31,7 +31,8 @@
*/
NanDataPathSecurityType securityType;
/**
- * Cipher type for data-paths. If |securityType| is |NanDataPathSecurityType.OPEN| then must
+ * One of |NanCipherSuiteType| indicating the cipher type for data-paths.
+ * If |securityType| is |NanDataPathSecurityType.OPEN|, then this must
* be set to |NanCipherSuiteType.NONE|. Otherwise a non-|NanCipherSuiteType.NONE| cipher suite
* must be specified.
*/
diff --git a/wifi/aidl/android/hardware/wifi/NanDiscoveryCommonConfig.aidl b/wifi/aidl/android/hardware/wifi/NanDiscoveryCommonConfig.aidl
index e98658b..58777c5 100644
--- a/wifi/aidl/android/hardware/wifi/NanDiscoveryCommonConfig.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanDiscoveryCommonConfig.aidl
@@ -18,7 +18,6 @@
import android.hardware.wifi.NanDataPathSecurityConfig;
import android.hardware.wifi.NanMatchAlg;
-import android.hardware.wifi.NanRangingIndication;
/**
* Configurations of NAN discovery sessions. Common to publish and subscribe discovery.
@@ -143,10 +142,11 @@
*/
int rangingIntervalMs;
/**
- * The type of ranging feedback to be provided by discovery session matches
- * |IWifiNanIfaceEventCallback.eventMatch|. Only relevant if |rangingRequired| is true.
+ * Bitmap of |NanRangingIndication| values indicating the type of ranging feedback
+ * to be provided by discovery session matches in |IWifiNanIfaceEventCallback.eventMatch|.
+ * Only relevant if |rangingRequired| is true.
*/
- NanRangingIndication configRangingIndications;
+ int configRangingIndications;
/**
* The ingress and egress distance in cm. If ranging is enabled (|rangingEnabled| is true) then
* |configRangingIndications| is used to determine whether ingress and/or egress (or neither)
diff --git a/wifi/aidl/android/hardware/wifi/NanIdentityResolutionAttribute.aidl b/wifi/aidl/android/hardware/wifi/NanIdentityResolutionAttribute.aidl
index 917feff..807081b 100644
--- a/wifi/aidl/android/hardware/wifi/NanIdentityResolutionAttribute.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanIdentityResolutionAttribute.aidl
@@ -17,7 +17,8 @@
package android.hardware.wifi;
/**
- * NIRA for pairing identity resolution
+ * NIRA for pairing identity resolution.
+ * See Wi-Fi Aware R4.0 section 9.5.21.6
*/
@VintfStability
parcelable NanIdentityResolutionAttribute {
diff --git a/wifi/aidl/android/hardware/wifi/NanMatchInd.aidl b/wifi/aidl/android/hardware/wifi/NanMatchInd.aidl
index 314d599..5a04376 100644
--- a/wifi/aidl/android/hardware/wifi/NanMatchInd.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanMatchInd.aidl
@@ -19,7 +19,6 @@
import android.hardware.wifi.NanCipherSuiteType;
import android.hardware.wifi.NanIdentityResolutionAttribute;
import android.hardware.wifi.NanPairingConfig;
-import android.hardware.wifi.NanRangingIndication;
/**
* Match indication structure.
@@ -81,8 +80,9 @@
*/
byte rssiValue;
/**
- * Cipher type for data-paths constructed in the context of this discovery session. Valid if
- * |peerRequiresSecurityEnabledInNdp| is true.
+ * One of |NanCipherSuiteType| indicating the cipher type for data-paths constructed
+ * in the context of this discovery session.
+ * Valid if |peerRequiresSecurityEnabledInNdp| is true.
*/
NanCipherSuiteType peerCipherType;
/**
@@ -117,10 +117,11 @@
*/
int rangingMeasurementInMm;
/**
- * The ranging event(s) which triggered the ranging. e.g. can indicate that continuous ranging
- * was requested, or else that an ingress event occurred.
+ * Bitmap of |NanRangingIndication| values indicating the ranging event(s) which triggered the
+ * ranging. e.g. can indicate that continuous ranging was requested, or else that an ingress
+ * event occurred.
*/
- NanRangingIndication rangingIndicationType;
+ int rangingIndicationType;
/**
* Security Context Identifier attribute contains PMKID. Shall be included in NDP setup and
* response messages. Security Context Identifier identifies the Security Context. For NAN
diff --git a/wifi/aidl/android/hardware/wifi/NanPairingConfig.aidl b/wifi/aidl/android/hardware/wifi/NanPairingConfig.aidl
index 4f9c3ae..609dac2 100644
--- a/wifi/aidl/android/hardware/wifi/NanPairingConfig.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanPairingConfig.aidl
@@ -16,8 +16,6 @@
package android.hardware.wifi;
-import android.hardware.wifi.NanBootstrappingMethod;
-
/**
* The NAN pairing config
*/
@@ -36,7 +34,8 @@
*/
boolean enablePairingVerification;
/**
- * The set of supported bootstrapping methods. The |NanBootstrappingMethod| bit fields are used.
+ * Bitmap of |NanBootstrappingMethod| values indicating the set of
+ * supported bootstrapping methods.
*/
int supportedBootstrappingMethods;
}
diff --git a/wifi/aidl/android/hardware/wifi/NanPairingConfirmInd.aidl b/wifi/aidl/android/hardware/wifi/NanPairingConfirmInd.aidl
index cd98c72..a5670ec 100644
--- a/wifi/aidl/android/hardware/wifi/NanPairingConfirmInd.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanPairingConfirmInd.aidl
@@ -16,7 +16,6 @@
package android.hardware.wifi;
-import android.hardware.wifi.NanDataPathChannelInfo;
import android.hardware.wifi.NanPairingRequestType;
import android.hardware.wifi.NanStatus;
import android.hardware.wifi.NpkSecurityAssociation;
@@ -24,7 +23,7 @@
/**
* NAN pairing confirmation indication structure. Event indication is
* received on both initiator and responder side when negotiation for a
- * pairing finishes on success or failure.
+ * pairing finishes on success or failure. See Wi-Fi Aware R4.0 section 7.6.1.4
*/
@VintfStability
parcelable NanPairingConfirmInd {
diff --git a/wifi/aidl/android/hardware/wifi/NanPairingRequest.aidl b/wifi/aidl/android/hardware/wifi/NanPairingRequest.aidl
index 6f1a072..0c2080b 100644
--- a/wifi/aidl/android/hardware/wifi/NanPairingRequest.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanPairingRequest.aidl
@@ -20,9 +20,10 @@
import android.hardware.wifi.NanPairingSecurityConfig;
/**
- * NAN pairing initiate request
- * Which can be used for setup(the initial pairing request) or
- * verification(re-pairing for paired devices)
+ * NAN pairing initiate request.
+ * Can be used for setup (the initial pairing request) or
+ * verification (re-pairing for paired devices).
+ * See Wi-Fi Aware R4.0 section 7.6.1.1
*/
@VintfStability
parcelable NanPairingRequest {
diff --git a/wifi/aidl/android/hardware/wifi/NanPairingRequestInd.aidl b/wifi/aidl/android/hardware/wifi/NanPairingRequestInd.aidl
index f247e45..ec8548f 100644
--- a/wifi/aidl/android/hardware/wifi/NanPairingRequestInd.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanPairingRequestInd.aidl
@@ -22,7 +22,7 @@
/**
* NAN pairing request indication message structure.
* Event indication received by an intended Responder when a
- * pairing request initiated by an Initiator.
+ * pairing request is initiated by an Initiator. See Wi-Fi Aware R4.0 section 7.6.1.3
*/
@VintfStability
parcelable NanPairingRequestInd {
diff --git a/wifi/aidl/android/hardware/wifi/NanPairingSecurityConfig.aidl b/wifi/aidl/android/hardware/wifi/NanPairingSecurityConfig.aidl
index 7384e1a..a601751 100644
--- a/wifi/aidl/android/hardware/wifi/NanPairingSecurityConfig.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanPairingSecurityConfig.aidl
@@ -49,8 +49,8 @@
*/
NanPairingAkm akm;
/**
- * Cipher type for pairing. Need to be one of the |NanCipherSuiteType.PUBLIC_KEY_PASN_128_MASK|
- * or |NanCipherSuiteType.PUBLIC_KEY_PASN_256_MASK|
+ * Cipher type for pairing. Must be one of |NanCipherSuiteType.PUBLIC_KEY_PASN_128_MASK|
+ * or |NanCipherSuiteType.PUBLIC_KEY_PASN_256_MASK|.
*/
NanCipherSuiteType cipherType;
}
diff --git a/wifi/aidl/android/hardware/wifi/NanRespondToPairingIndicationRequest.aidl b/wifi/aidl/android/hardware/wifi/NanRespondToPairingIndicationRequest.aidl
index 456b430..fab2a40 100644
--- a/wifi/aidl/android/hardware/wifi/NanRespondToPairingIndicationRequest.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanRespondToPairingIndicationRequest.aidl
@@ -21,6 +21,7 @@
/**
* Response to a pairing request from a peer.
+ * See Wi-Fi Aware R4.0 section 7.6.1.2
*/
@VintfStability
parcelable NanRespondToPairingIndicationRequest {
diff --git a/wifi/aidl/android/hardware/wifi/NanSuspensionModeChangeInd.aidl b/wifi/aidl/android/hardware/wifi/NanSuspensionModeChangeInd.aidl
index afabe8c..057e63b 100644
--- a/wifi/aidl/android/hardware/wifi/NanSuspensionModeChangeInd.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanSuspensionModeChangeInd.aidl
@@ -22,7 +22,7 @@
@VintfStability
parcelable NanSuspensionModeChangeInd {
/**
- * Indication whether the device has entered or existed the NAN suspension mode(deep sleep)
+ * Indication whether the device has entered or exited the NAN suspension mode(deep sleep)
*/
boolean isSuspended;
}
diff --git a/wifi/aidl/android/hardware/wifi/NpkSecurityAssociation.aidl b/wifi/aidl/android/hardware/wifi/NpkSecurityAssociation.aidl
index 6d85eea..4d65a41 100644
--- a/wifi/aidl/android/hardware/wifi/NpkSecurityAssociation.aidl
+++ b/wifi/aidl/android/hardware/wifi/NpkSecurityAssociation.aidl
@@ -41,8 +41,8 @@
*/
NanPairingAkm akm;
/**
- * Cipher type for pairing. Need to one of the |NanCipherSuiteType.PUBLIC_KEY_PASN_128_MASK| or
- * |NanCipherSuiteType.PUBLIC_KEY_PASN_256_MASK|
+ * Cipher type for pairing. Must be one of |NanCipherSuiteType.PUBLIC_KEY_PASN_128_MASK| or
+ * |NanCipherSuiteType.PUBLIC_KEY_PASN_256_MASK|.
*/
NanCipherSuiteType cipherType;
}
diff --git a/wifi/aidl/android/hardware/wifi/StaBackgroundScanBucketParameters.aidl b/wifi/aidl/android/hardware/wifi/StaBackgroundScanBucketParameters.aidl
index 7bd87b2..76b510d 100644
--- a/wifi/aidl/android/hardware/wifi/StaBackgroundScanBucketParameters.aidl
+++ b/wifi/aidl/android/hardware/wifi/StaBackgroundScanBucketParameters.aidl
@@ -16,7 +16,6 @@
package android.hardware.wifi;
-import android.hardware.wifi.StaBackgroundScanBucketEventReportSchemeMask;
import android.hardware.wifi.WifiBand;
/**
@@ -50,7 +49,7 @@
* Bitset of |StaBackgroundScanBucketEventReportSchemeMask| values controlling
* when events for this bucket must be reported.
*/
- StaBackgroundScanBucketEventReportSchemeMask eventReportScheme;
+ int eventReportScheme;
/**
* For exponential back off. If |exponentialMaxPeriodInMs| is non-zero or
* different than period, then this bucket is an exponential backoff bucket
diff --git a/wifi/aidl/android/hardware/wifi/StaScanData.aidl b/wifi/aidl/android/hardware/wifi/StaScanData.aidl
index 9d6bd53..abc5638 100644
--- a/wifi/aidl/android/hardware/wifi/StaScanData.aidl
+++ b/wifi/aidl/android/hardware/wifi/StaScanData.aidl
@@ -16,7 +16,6 @@
package android.hardware.wifi;
-import android.hardware.wifi.StaScanDataFlagMask;
import android.hardware.wifi.StaScanResult;
/**
@@ -26,9 +25,9 @@
@VintfStability
parcelable StaScanData {
/**
- * Bitset containing |ScanDataFlagMask| values.
+ * Bitset of |ScanDataFlagMask| values.
*/
- StaScanDataFlagMask flags;
+ int flags;
/**
* Bitset where each bit indicates if the bucket with that index (starting at
* 0) was scanned.
diff --git a/wifi/aidl/android/hardware/wifi/WifiRadioCombinationMatrix.aidl b/wifi/aidl/android/hardware/wifi/WifiRadioCombinationMatrix.aidl
deleted file mode 100644
index b79a818..0000000
--- a/wifi/aidl/android/hardware/wifi/WifiRadioCombinationMatrix.aidl
+++ /dev/null
@@ -1,31 +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.
- */
-
-package android.hardware.wifi;
-
-import android.hardware.wifi.WifiRadioCombination;
-
-/**
- * Wifi radio combinations matrix retrieved via
- * |IWifiChip.getSupportedRadioCombinationsMatrix|.
- */
-@VintfStability
-parcelable WifiRadioCombinationMatrix {
- /**
- * List of all the possible radio combinations that the chip can operate.
- */
- WifiRadioCombination[] radioCombinations;
-}
diff --git a/wifi/aidl/android/hardware/wifi/WifiUsableChannel.aidl b/wifi/aidl/android/hardware/wifi/WifiUsableChannel.aidl
index d92e4cc..077c17e 100644
--- a/wifi/aidl/android/hardware/wifi/WifiUsableChannel.aidl
+++ b/wifi/aidl/android/hardware/wifi/WifiUsableChannel.aidl
@@ -17,7 +17,6 @@
package android.hardware.wifi;
import android.hardware.wifi.WifiChannelWidthInMhz;
-import android.hardware.wifi.WifiIfaceMode;
/**
* Wifi usable channel information.
@@ -33,7 +32,8 @@
*/
WifiChannelWidthInMhz channelBandwidth;
/**
- * Iface modes feasible on this channel.
+ * Iface modes feasible on this channel, represented as a bitmask
+ * of |WifiIfaceMode| values.
*/
- WifiIfaceMode ifaceModeMask;
+ int ifaceModeMask;
}
diff --git a/wifi/aidl/default/aidl_struct_util.cpp b/wifi/aidl/default/aidl_struct_util.cpp
index d3cf7bf..4acdd2f 100644
--- a/wifi/aidl/default/aidl_struct_util.cpp
+++ b/wifi/aidl/default/aidl_struct_util.cpp
@@ -408,8 +408,8 @@
aidl_usable_channel->channel = legacy_usable_channel.freq;
aidl_usable_channel->channelBandwidth =
convertLegacyWifiChannelWidthToAidl(legacy_usable_channel.width);
- aidl_usable_channel->ifaceModeMask = static_cast<WifiIfaceMode>(
- convertLegacyWifiInterfaceModeToAidl(legacy_usable_channel.iface_mode_mask));
+ aidl_usable_channel->ifaceModeMask =
+ convertLegacyWifiInterfaceModeToAidl(legacy_usable_channel.iface_mode_mask);
return true;
}
@@ -572,7 +572,7 @@
legacy_bucket_spec.report_events = 0;
using AidlFlag = StaBackgroundScanBucketEventReportSchemeMask;
for (const auto flag : {AidlFlag::EACH_SCAN, AidlFlag::FULL_RESULTS, AidlFlag::NO_BATCH}) {
- if (static_cast<int32_t>(aidl_bucket_spec.eventReportScheme) &
+ if (aidl_bucket_spec.eventReportScheme &
static_cast<std::underlying_type<AidlFlag>::type>(flag)) {
legacy_bucket_spec.report_events |= convertAidlGscanReportEventFlagToLegacy(flag);
}
@@ -678,7 +678,7 @@
convertLegacyGscanDataFlagToAidl(flag));
}
}
- aidl_scan_data->flags = static_cast<StaScanDataFlagMask>(flags);
+ aidl_scan_data->flags = flags;
aidl_scan_data->bucketsScanned = legacy_cached_scan_result.buckets_scanned;
CHECK(legacy_cached_scan_result.num_results >= 0 &&
@@ -1787,7 +1787,7 @@
: legacy_hal::NAN_RANGING_DISABLE;
legacy_request->ranging_cfg.ranging_interval_msec = aidl_request.baseConfigs.rangingIntervalMs;
legacy_request->ranging_cfg.config_ranging_indications =
- static_cast<uint32_t>(aidl_request.baseConfigs.configRangingIndications);
+ aidl_request.baseConfigs.configRangingIndications;
legacy_request->ranging_cfg.distance_ingress_mm =
aidl_request.baseConfigs.distanceIngressCm * 10;
legacy_request->ranging_cfg.distance_egress_mm = aidl_request.baseConfigs.distanceEgressCm * 10;
@@ -1919,7 +1919,7 @@
: legacy_hal::NAN_RANGING_DISABLE;
legacy_request->ranging_cfg.ranging_interval_msec = aidl_request.baseConfigs.rangingIntervalMs;
legacy_request->ranging_cfg.config_ranging_indications =
- static_cast<uint32_t>(aidl_request.baseConfigs.configRangingIndications);
+ aidl_request.baseConfigs.configRangingIndications;
legacy_request->ranging_cfg.distance_ingress_mm =
aidl_request.baseConfigs.distanceIngressCm * 10;
legacy_request->ranging_cfg.distance_egress_mm = aidl_request.baseConfigs.distanceEgressCm * 10;
@@ -2202,8 +2202,7 @@
aidl_response->maxQueuedTransmitFollowupMsgs =
legacy_response.max_queued_transmit_followup_msgs;
aidl_response->maxSubscribeInterfaceAddresses = legacy_response.max_subscribe_address;
- aidl_response->supportedCipherSuites =
- static_cast<NanCipherSuiteType>(legacy_response.cipher_suites_supported);
+ aidl_response->supportedCipherSuites = legacy_response.cipher_suites_supported;
aidl_response->instantCommunicationModeSupportFlag = legacy_response.is_instant_mode_supported;
aidl_response->supports6g = legacy_response.is_6g_supported;
aidl_response->supportsHe = legacy_response.is_he_supported;
@@ -2244,8 +2243,7 @@
aidl_ind->peerRequiresRanging =
legacy_ind.peer_sdea_params.ranging_state == legacy_hal::NAN_RANGING_ENABLE;
aidl_ind->rangingMeasurementInMm = legacy_ind.range_info.range_measurement_mm;
- aidl_ind->rangingIndicationType =
- static_cast<NanRangingIndication>(legacy_ind.range_info.ranging_event_type);
+ aidl_ind->rangingIndicationType = legacy_ind.range_info.ranging_event_type;
aidl_ind->scid = std::vector<uint8_t>(legacy_ind.scid, legacy_ind.scid + legacy_ind.scid_len);
if (!convertLegacyNiraToAidl(legacy_ind.nira, &aidl_ind->peerNira)) {
@@ -2996,14 +2994,13 @@
bool convertLegacyRadioCombinationsMatrixToAidl(
legacy_hal::wifi_radio_combination_matrix* legacy_matrix,
- WifiRadioCombinationMatrix* aidl_matrix) {
- if (!aidl_matrix || !legacy_matrix) {
+ std::vector<WifiRadioCombination>* aidl_combinations) {
+ if (!aidl_combinations || !legacy_matrix) {
return false;
}
- *aidl_matrix = {};
+ *aidl_combinations = {};
int num_combinations = legacy_matrix->num_radio_combinations;
- std::vector<WifiRadioCombination> radio_combinations_vec;
if (!num_combinations) {
LOG(ERROR) << "zero radio combinations";
return false;
@@ -3029,13 +3026,12 @@
radio_configurations_vec.push_back(radioConfiguration);
}
radioCombination.radioConfigurations = radio_configurations_vec;
- radio_combinations_vec.push_back(radioCombination);
+ aidl_combinations->push_back(radioCombination);
l_radio_combinations_ptr =
(wifi_radio_combination*)((u8*)l_radio_combinations_ptr +
sizeof(wifi_radio_combination) +
(sizeof(wifi_radio_configuration) * num_configurations));
}
- aidl_matrix->radioCombinations = radio_combinations_vec;
return true;
}
diff --git a/wifi/aidl/default/aidl_struct_util.h b/wifi/aidl/default/aidl_struct_util.h
index 208b734..9a13672 100644
--- a/wifi/aidl/default/aidl_struct_util.h
+++ b/wifi/aidl/default/aidl_struct_util.h
@@ -20,7 +20,10 @@
#include <aidl/android/hardware/wifi/IWifiChip.h>
#include <aidl/android/hardware/wifi/IWifiChipEventCallback.h>
#include <aidl/android/hardware/wifi/NanBandIndex.h>
+#include <aidl/android/hardware/wifi/StaBackgroundScanBucketEventReportSchemeMask.h>
+#include <aidl/android/hardware/wifi/StaScanDataFlagMask.h>
#include <aidl/android/hardware/wifi/WifiDebugRingBufferFlags.h>
+#include <aidl/android/hardware/wifi/WifiIfaceMode.h>
#include <vector>
@@ -64,7 +67,7 @@
std::vector<legacy_hal::wifi_coex_unsafe_channel>* legacy_unsafe_channels);
bool convertLegacyRadioCombinationsMatrixToAidl(
legacy_hal::wifi_radio_combination_matrix* legacy_matrix,
- WifiRadioCombinationMatrix* aidl_matrix);
+ std::vector<WifiRadioCombination>* aidl_combinations);
WifiBand convertLegacyMacBandToAidlWifiBand(uint32_t band);
WifiAntennaMode convertLegacyAntennaConfigurationToAidl(uint32_t antenna_cfg);
bool convertLegacyIfaceCombinationsMatrixToChipMode(
diff --git a/wifi/aidl/default/tests/aidl_struct_util_unit_tests.cpp b/wifi/aidl/default/tests/aidl_struct_util_unit_tests.cpp
index 9997937..4bd77ac 100644
--- a/wifi/aidl/default/tests/aidl_struct_util_unit_tests.cpp
+++ b/wifi/aidl/default/tests/aidl_struct_util_unit_tests.cpp
@@ -753,21 +753,22 @@
sizeof(radio_configurations_array3) / sizeof(radio_configurations_array3[0]),
radio_configurations_array3);
- WifiRadioCombinationMatrix converted_matrix{};
- aidl_struct_util::convertLegacyRadioCombinationsMatrixToAidl(legacy_matrix, &converted_matrix);
+ std::vector<WifiRadioCombination> converted_combinations;
+ aidl_struct_util::convertLegacyRadioCombinationsMatrixToAidl(legacy_matrix,
+ &converted_combinations);
// Verify the conversion
- EXPECT_EQ(legacy_matrix->num_radio_combinations, converted_matrix.radioCombinations.size());
+ EXPECT_EQ(legacy_matrix->num_radio_combinations, converted_combinations.size());
verifyRadioCombination(
- &converted_matrix.radioCombinations[0],
+ &converted_combinations[0],
sizeof(radio_configurations_array1) / sizeof(radio_configurations_array1[0]),
radio_configurations_array1);
verifyRadioCombination(
- &converted_matrix.radioCombinations[1],
+ &converted_combinations[1],
sizeof(radio_configurations_array2) / sizeof(radio_configurations_array2[0]),
radio_configurations_array2);
verifyRadioCombination(
- &converted_matrix.radioCombinations[2],
+ &converted_combinations[2],
sizeof(radio_configurations_array3) / sizeof(radio_configurations_array3[0]),
radio_configurations_array3);
}
diff --git a/wifi/aidl/default/wifi_chip.cpp b/wifi/aidl/default/wifi_chip.cpp
index bb3eaf0..dd24e6b 100644
--- a/wifi/aidl/default/wifi_chip.cpp
+++ b/wifi/aidl/default/wifi_chip.cpp
@@ -455,7 +455,7 @@
&WifiChip::registerEventCallbackInternal, event_callback);
}
-ndk::ScopedAStatus WifiChip::getCapabilities(IWifiChip::ChipCapabilityMask* _aidl_return) {
+ndk::ScopedAStatus WifiChip::getCapabilities(int32_t* _aidl_return) {
return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
&WifiChip::getCapabilitiesInternal, _aidl_return);
}
@@ -681,7 +681,7 @@
ndk::ScopedAStatus WifiChip::setCoexUnsafeChannels(
const std::vector<IWifiChip::CoexUnsafeChannel>& in_unsafeChannels,
- CoexRestriction in_restrictions) {
+ int32_t in_restrictions) {
return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
&WifiChip::setCoexUnsafeChannelsInternal, in_unsafeChannels,
in_restrictions);
@@ -692,8 +692,8 @@
&WifiChip::setCountryCodeInternal, in_code);
}
-ndk::ScopedAStatus WifiChip::getUsableChannels(WifiBand in_band, WifiIfaceMode in_ifaceModeMask,
- UsableChannelFilter in_filterMask,
+ndk::ScopedAStatus WifiChip::getUsableChannels(WifiBand in_band, int32_t in_ifaceModeMask,
+ int32_t in_filterMask,
std::vector<WifiUsableChannel>* _aidl_return) {
return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
&WifiChip::getUsableChannelsInternal, _aidl_return, in_band,
@@ -711,10 +711,10 @@
&WifiChip::triggerSubsystemRestartInternal);
}
-ndk::ScopedAStatus WifiChip::getSupportedRadioCombinationsMatrix(
- WifiRadioCombinationMatrix* _aidl_return) {
+ndk::ScopedAStatus WifiChip::getSupportedRadioCombinations(
+ std::vector<WifiRadioCombination>* _aidl_return) {
return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
- &WifiChip::getSupportedRadioCombinationsMatrixInternal, _aidl_return);
+ &WifiChip::getSupportedRadioCombinationsInternal, _aidl_return);
}
ndk::ScopedAStatus WifiChip::getWifiChipCapabilities(WifiChipCapabilities* _aidl_return) {
@@ -722,8 +722,7 @@
&WifiChip::getWifiChipCapabilitiesInternal, _aidl_return);
}
-ndk::ScopedAStatus WifiChip::enableStaChannelForPeerNetwork(
- ChannelCategoryMask in_channelCategoryEnableFlag) {
+ndk::ScopedAStatus WifiChip::enableStaChannelForPeerNetwork(int32_t in_channelCategoryEnableFlag) {
return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
&WifiChip::enableStaChannelForPeerNetworkInternal,
in_channelCategoryEnableFlag);
@@ -787,7 +786,7 @@
return ndk::ScopedAStatus::ok();
}
-std::pair<IWifiChip::ChipCapabilityMask, ndk::ScopedAStatus> WifiChip::getCapabilitiesInternal() {
+std::pair<int32_t, ndk::ScopedAStatus> WifiChip::getCapabilitiesInternal() {
legacy_hal::wifi_error legacy_status;
uint64_t legacy_feature_set;
uint32_t legacy_logger_feature_set;
@@ -795,7 +794,7 @@
std::tie(legacy_status, legacy_feature_set) =
legacy_hal_.lock()->getSupportedFeatureSet(ifname);
if (legacy_status != legacy_hal::WIFI_SUCCESS) {
- return {IWifiChip::ChipCapabilityMask{}, createWifiStatusFromLegacyError(legacy_status)};
+ return {0, createWifiStatusFromLegacyError(legacy_status)};
}
std::tie(legacy_status, legacy_logger_feature_set) =
legacy_hal_.lock()->getLoggerSupportedFeatureSet(ifname);
@@ -806,9 +805,9 @@
uint32_t aidl_caps;
if (!aidl_struct_util::convertLegacyFeaturesToAidlChipCapabilities(legacy_feature_set,
&aidl_caps)) {
- return {IWifiChip::ChipCapabilityMask{}, createWifiStatus(WifiStatusCode::ERROR_UNKNOWN)};
+ return {0, createWifiStatus(WifiStatusCode::ERROR_UNKNOWN)};
}
- return {static_cast<IWifiChip::ChipCapabilityMask>(aidl_caps), ndk::ScopedAStatus::ok()};
+ return {aidl_caps, ndk::ScopedAStatus::ok()};
}
std::pair<std::vector<IWifiChip::ChipMode>, ndk::ScopedAStatus>
@@ -1385,13 +1384,12 @@
}
ndk::ScopedAStatus WifiChip::setCoexUnsafeChannelsInternal(
- std::vector<IWifiChip::CoexUnsafeChannel> unsafe_channels, CoexRestriction restrictions) {
+ std::vector<IWifiChip::CoexUnsafeChannel> unsafe_channels, int32_t aidl_restrictions) {
std::vector<legacy_hal::wifi_coex_unsafe_channel> legacy_unsafe_channels;
if (!aidl_struct_util::convertAidlVectorOfCoexUnsafeChannelToLegacy(unsafe_channels,
&legacy_unsafe_channels)) {
return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS);
}
- uint32_t aidl_restrictions = static_cast<uint32_t>(restrictions);
uint32_t legacy_restrictions = 0;
if (aidl_restrictions & static_cast<uint32_t>(CoexRestriction::WIFI_DIRECT)) {
legacy_restrictions |= legacy_hal::wifi_coex_restriction::WIFI_DIRECT;
@@ -1413,15 +1411,13 @@
}
std::pair<std::vector<WifiUsableChannel>, ndk::ScopedAStatus> WifiChip::getUsableChannelsInternal(
- WifiBand band, WifiIfaceMode ifaceModeMask, UsableChannelFilter filterMask) {
+ WifiBand band, int32_t ifaceModeMask, int32_t filterMask) {
legacy_hal::wifi_error legacy_status;
std::vector<legacy_hal::wifi_usable_channel> legacy_usable_channels;
std::tie(legacy_status, legacy_usable_channels) = legacy_hal_.lock()->getUsableChannels(
aidl_struct_util::convertAidlWifiBandToLegacyMacBand(band),
- aidl_struct_util::convertAidlWifiIfaceModeToLegacy(
- static_cast<uint32_t>(ifaceModeMask)),
- aidl_struct_util::convertAidlUsableChannelFilterToLegacy(
- static_cast<uint32_t>(filterMask)));
+ aidl_struct_util::convertAidlWifiIfaceModeToLegacy(ifaceModeMask),
+ aidl_struct_util::convertAidlUsableChannelFilterToLegacy(filterMask));
if (legacy_status != legacy_hal::WIFI_SUCCESS) {
return {std::vector<WifiUsableChannel>(), createWifiStatusFromLegacyError(legacy_status)};
@@ -1440,26 +1436,26 @@
return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED);
}
-std::pair<WifiRadioCombinationMatrix, ndk::ScopedAStatus>
-WifiChip::getSupportedRadioCombinationsMatrixInternal() {
+std::pair<std::vector<WifiRadioCombination>, ndk::ScopedAStatus>
+WifiChip::getSupportedRadioCombinationsInternal() {
legacy_hal::wifi_error legacy_status;
legacy_hal::wifi_radio_combination_matrix* legacy_matrix;
+ std::vector<WifiRadioCombination> aidl_combinations;
std::tie(legacy_status, legacy_matrix) =
legacy_hal_.lock()->getSupportedRadioCombinationsMatrix();
if (legacy_status != legacy_hal::WIFI_SUCCESS) {
LOG(ERROR) << "Failed to get SupportedRadioCombinations matrix from legacy HAL: "
<< legacyErrorToString(legacy_status);
- return {WifiRadioCombinationMatrix{}, createWifiStatusFromLegacyError(legacy_status)};
+ return {aidl_combinations, createWifiStatusFromLegacyError(legacy_status)};
}
- WifiRadioCombinationMatrix aidl_matrix;
if (!aidl_struct_util::convertLegacyRadioCombinationsMatrixToAidl(legacy_matrix,
- &aidl_matrix)) {
+ &aidl_combinations)) {
LOG(ERROR) << "Failed convertLegacyRadioCombinationsMatrixToAidl() ";
- return {WifiRadioCombinationMatrix(), createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS)};
+ return {aidl_combinations, createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS)};
}
- return {aidl_matrix, ndk::ScopedAStatus::ok()};
+ return {aidl_combinations, ndk::ScopedAStatus::ok()};
}
std::pair<WifiChipCapabilities, ndk::ScopedAStatus> WifiChip::getWifiChipCapabilitiesInternal() {
@@ -1483,10 +1479,9 @@
}
ndk::ScopedAStatus WifiChip::enableStaChannelForPeerNetworkInternal(
- ChannelCategoryMask channelCategoryEnableFlag) {
+ int32_t channelCategoryEnableFlag) {
auto legacy_status = legacy_hal_.lock()->enableStaChannelForPeerNetwork(
- aidl_struct_util::convertAidlChannelCategoryToLegacy(
- static_cast<uint32_t>(channelCategoryEnableFlag)));
+ aidl_struct_util::convertAidlChannelCategoryToLegacy(channelCategoryEnableFlag));
return createWifiStatusFromLegacyError(legacy_status);
}
diff --git a/wifi/aidl/default/wifi_chip.h b/wifi/aidl/default/wifi_chip.h
index def5da0..c5dcee7 100644
--- a/wifi/aidl/default/wifi_chip.h
+++ b/wifi/aidl/default/wifi_chip.h
@@ -85,7 +85,7 @@
ndk::ScopedAStatus getId(int32_t* _aidl_return) override;
ndk::ScopedAStatus registerEventCallback(
const std::shared_ptr<IWifiChipEventCallback>& in_callback) override;
- ndk::ScopedAStatus getCapabilities(IWifiChip::ChipCapabilityMask* _aidl_return) override;
+ ndk::ScopedAStatus getCapabilities(int32_t* _aidl_return) override;
ndk::ScopedAStatus getAvailableModes(std::vector<IWifiChip::ChipMode>* _aidl_return) override;
ndk::ScopedAStatus configureChip(int32_t in_modeId) override;
ndk::ScopedAStatus getMode(int32_t* _aidl_return) override;
@@ -136,19 +136,19 @@
ndk::ScopedAStatus setMultiStaUseCase(IWifiChip::MultiStaUseCase in_useCase) override;
ndk::ScopedAStatus setCoexUnsafeChannels(
const std::vector<IWifiChip::CoexUnsafeChannel>& in_unsafeChannels,
- CoexRestriction in_restrictions) override;
+ int32_t in_restrictions) override;
ndk::ScopedAStatus setCountryCode(const std::array<uint8_t, 2>& in_code) override;
- ndk::ScopedAStatus getUsableChannels(WifiBand in_band, WifiIfaceMode in_ifaceModeMask,
- UsableChannelFilter in_filterMask,
+ ndk::ScopedAStatus getUsableChannels(WifiBand in_band, int32_t in_ifaceModeMask,
+ int32_t in_filterMask,
std::vector<WifiUsableChannel>* _aidl_return) override;
ndk::ScopedAStatus setAfcChannelAllowance(
const std::vector<AvailableAfcFrequencyInfo>& availableAfcFrequencyInfo) override;
ndk::ScopedAStatus triggerSubsystemRestart() override;
- ndk::ScopedAStatus getSupportedRadioCombinationsMatrix(
- WifiRadioCombinationMatrix* _aidl_return) override;
+ ndk::ScopedAStatus getSupportedRadioCombinations(
+ std::vector<WifiRadioCombination>* _aidl_return) override;
ndk::ScopedAStatus getWifiChipCapabilities(WifiChipCapabilities* _aidl_return) override;
ndk::ScopedAStatus enableStaChannelForPeerNetwork(
- ChannelCategoryMask in_channelCategoryEnableFlag) override;
+ int32_t in_channelCategoryEnableFlag) override;
binder_status_t dump(int fd, const char** args, uint32_t numArgs) override;
ndk::ScopedAStatus setMloMode(const ChipMloMode in_mode) override;
@@ -162,7 +162,7 @@
std::pair<int32_t, ndk::ScopedAStatus> getIdInternal();
ndk::ScopedAStatus registerEventCallbackInternal(
const std::shared_ptr<IWifiChipEventCallback>& event_callback);
- std::pair<IWifiChip::ChipCapabilityMask, ndk::ScopedAStatus> getCapabilitiesInternal();
+ std::pair<int32_t, ndk::ScopedAStatus> getCapabilitiesInternal();
std::pair<std::vector<IWifiChip::ChipMode>, ndk::ScopedAStatus> getAvailableModesInternal();
ndk::ScopedAStatus configureChipInternal(std::unique_lock<std::recursive_mutex>* lock,
int32_t mode_id);
@@ -214,13 +214,11 @@
ndk::ScopedAStatus setMultiStaPrimaryConnectionInternal(const std::string& ifname);
ndk::ScopedAStatus setMultiStaUseCaseInternal(IWifiChip::MultiStaUseCase use_case);
ndk::ScopedAStatus setCoexUnsafeChannelsInternal(
- std::vector<IWifiChip::CoexUnsafeChannel> unsafe_channels,
- CoexRestriction restrictions);
+ std::vector<IWifiChip::CoexUnsafeChannel> unsafe_channels, int32_t restrictions);
ndk::ScopedAStatus setCountryCodeInternal(const std::array<uint8_t, 2>& in_code);
std::pair<std::vector<WifiUsableChannel>, ndk::ScopedAStatus> getUsableChannelsInternal(
- WifiBand band, WifiIfaceMode ifaceModeMask, UsableChannelFilter filterMask);
- ndk::ScopedAStatus enableStaChannelForPeerNetworkInternal(
- ChannelCategoryMask channelCategoryEnableFlag);
+ WifiBand band, int32_t ifaceModeMask, int32_t filterMask);
+ ndk::ScopedAStatus enableStaChannelForPeerNetworkInternal(int32_t channelCategoryEnableFlag);
ndk::ScopedAStatus setAfcChannelAllowanceInternal(
const std::vector<AvailableAfcFrequencyInfo>& availableAfcFrequencyInfo);
ndk::ScopedAStatus handleChipConfiguration(std::unique_lock<std::recursive_mutex>* lock,
@@ -258,8 +256,8 @@
void invalidateAndClearBridgedAp(const std::string& br_name);
bool findUsingNameFromBridgedApInstances(const std::string& name);
ndk::ScopedAStatus triggerSubsystemRestartInternal();
- std::pair<WifiRadioCombinationMatrix, ndk::ScopedAStatus>
- getSupportedRadioCombinationsMatrixInternal();
+ std::pair<std::vector<WifiRadioCombination>, ndk::ScopedAStatus>
+ getSupportedRadioCombinationsInternal();
std::pair<WifiChipCapabilities, ndk::ScopedAStatus> getWifiChipCapabilitiesInternal();
ndk::ScopedAStatus setMloModeInternal(const ChipMloMode in_mode);
void retrieveDynamicIfaceCombination();
diff --git a/wifi/aidl/default/wifi_sta_iface.cpp b/wifi/aidl/default/wifi_sta_iface.cpp
index 300316a..eceeeb5 100644
--- a/wifi/aidl/default/wifi_sta_iface.cpp
+++ b/wifi/aidl/default/wifi_sta_iface.cpp
@@ -82,8 +82,7 @@
&WifiStaIface::registerEventCallbackInternal, in_callback);
}
-ndk::ScopedAStatus WifiStaIface::getCapabilities(
- IWifiStaIface::StaIfaceCapabilityMask* _aidl_return) {
+ndk::ScopedAStatus WifiStaIface::getCapabilities(int32_t* _aidl_return) {
return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
&WifiStaIface::getCapabilitiesInternal, _aidl_return);
}
@@ -239,24 +238,20 @@
return ndk::ScopedAStatus::ok();
}
-std::pair<IWifiStaIface::StaIfaceCapabilityMask, ndk::ScopedAStatus>
-WifiStaIface::getCapabilitiesInternal() {
+std::pair<int32_t, ndk::ScopedAStatus> WifiStaIface::getCapabilitiesInternal() {
legacy_hal::wifi_error legacy_status;
uint64_t legacy_feature_set;
std::tie(legacy_status, legacy_feature_set) =
legacy_hal_.lock()->getSupportedFeatureSet(ifname_);
if (legacy_status != legacy_hal::WIFI_SUCCESS) {
- return {IWifiStaIface::StaIfaceCapabilityMask{},
- createWifiStatusFromLegacyError(legacy_status)};
+ return {0, createWifiStatusFromLegacyError(legacy_status)};
}
uint32_t aidl_caps;
if (!aidl_struct_util::convertLegacyFeaturesToAidlStaCapabilities(legacy_feature_set,
&aidl_caps)) {
- return {IWifiStaIface::StaIfaceCapabilityMask{},
- createWifiStatus(WifiStatusCode::ERROR_UNKNOWN)};
+ return {0, createWifiStatus(WifiStatusCode::ERROR_UNKNOWN)};
}
- return {static_cast<IWifiStaIface::StaIfaceCapabilityMask>(aidl_caps),
- ndk::ScopedAStatus::ok()};
+ return {aidl_caps, ndk::ScopedAStatus::ok()};
}
std::pair<StaApfPacketFilterCapabilities, ndk::ScopedAStatus>
diff --git a/wifi/aidl/default/wifi_sta_iface.h b/wifi/aidl/default/wifi_sta_iface.h
index 2e4403a..0831e16 100644
--- a/wifi/aidl/default/wifi_sta_iface.h
+++ b/wifi/aidl/default/wifi_sta_iface.h
@@ -54,8 +54,7 @@
ndk::ScopedAStatus getName(std::string* _aidl_return) override;
ndk::ScopedAStatus registerEventCallback(
const std::shared_ptr<IWifiStaIfaceEventCallback>& in_callback) override;
- ndk::ScopedAStatus getCapabilities(
- IWifiStaIface::StaIfaceCapabilityMask* _aidl_return) override;
+ ndk::ScopedAStatus getCapabilities(int32_t* _aidl_return) override;
ndk::ScopedAStatus getApfPacketFilterCapabilities(
StaApfPacketFilterCapabilities* _aidl_return) override;
ndk::ScopedAStatus installApfPacketFilter(const std::vector<uint8_t>& in_program) override;
@@ -99,7 +98,7 @@
std::pair<std::string, ndk::ScopedAStatus> getNameInternal();
ndk::ScopedAStatus registerEventCallbackInternal(
const std::shared_ptr<IWifiStaIfaceEventCallback>& callback);
- std::pair<IWifiStaIface::StaIfaceCapabilityMask, ndk::ScopedAStatus> getCapabilitiesInternal();
+ std::pair<int32_t, ndk::ScopedAStatus> getCapabilitiesInternal();
std::pair<StaApfPacketFilterCapabilities, ndk::ScopedAStatus>
getApfPacketFilterCapabilitiesInternal();
ndk::ScopedAStatus installApfPacketFilterInternal(const std::vector<uint8_t>& program);
diff --git a/wifi/aidl/vts/functional/wifi_aidl_test_utils.cpp b/wifi/aidl/vts/functional/wifi_aidl_test_utils.cpp
index 463545b..4cf14a2 100644
--- a/wifi/aidl/vts/functional/wifi_aidl_test_utils.cpp
+++ b/wifi/aidl/vts/functional/wifi_aidl_test_utils.cpp
@@ -208,9 +208,9 @@
}
int32_t getChipCapabilities(const std::shared_ptr<IWifiChip>& wifi_chip) {
- IWifiChip::ChipCapabilityMask caps = {};
+ int32_t caps = 0;
if (wifi_chip->getCapabilities(&caps).isOk()) {
- return static_cast<int32_t>(caps);
+ return caps;
}
return 0;
}
diff --git a/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp b/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp
index f908be6..dbff949 100644
--- a/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp
+++ b/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp
@@ -22,6 +22,7 @@
#include <aidl/Vintf.h>
#include <aidl/android/hardware/wifi/BnWifi.h>
#include <aidl/android/hardware/wifi/BnWifiChipEventCallback.h>
+#include <aidl/android/hardware/wifi/WifiIfaceMode.h>
#include <android/binder_manager.h>
#include <android/binder_status.h>
#include <binder/IServiceManager.h>
@@ -41,7 +42,7 @@
using aidl::android::hardware::wifi::WifiDebugRingBufferStatus;
using aidl::android::hardware::wifi::WifiDebugRingBufferVerboseLevel;
using aidl::android::hardware::wifi::WifiIfaceMode;
-using aidl::android::hardware::wifi::WifiRadioCombinationMatrix;
+using aidl::android::hardware::wifi::WifiRadioCombination;
using aidl::android::hardware::wifi::WifiStatusCode;
using aidl::android::hardware::wifi::WifiUsableChannel;
@@ -232,9 +233,7 @@
std::vector<WifiUsableChannel> channels;
configureChipForConcurrencyType(IfaceConcurrencyType::STA);
- auto status = wifi_chip_->getUsableChannels(
- band, static_cast<WifiIfaceMode>(ifaceModeMask),
- static_cast<IWifiChip::UsableChannelFilter>(filterMask), &channels);
+ auto status = wifi_chip_->getUsableChannels(band, ifaceModeMask, filterMask, &channels);
if (checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)) {
GTEST_SKIP() << "getUsableChannels() is not supported by vendor.";
}
@@ -242,14 +241,14 @@
}
/*
- * GetSupportedRadioCombinationsMatrix
+ * GetSupportedRadioCombinations
*/
-TEST_P(WifiChipAidlTest, GetSupportedRadioCombinationsMatrix) {
- WifiRadioCombinationMatrix combination_matrix = {};
+TEST_P(WifiChipAidlTest, GetSupportedRadioCombinations) {
+ std::vector<WifiRadioCombination> combinations;
configureChipForConcurrencyType(IfaceConcurrencyType::STA);
- auto status = wifi_chip_->getSupportedRadioCombinationsMatrix(&combination_matrix);
+ auto status = wifi_chip_->getSupportedRadioCombinations(&combinations);
if (checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)) {
- GTEST_SKIP() << "Skipping this test since getSupportedRadioCombinationsMatrix() "
+ GTEST_SKIP() << "Skipping this test since getSupportedRadioCombinations() "
"is not supported by vendor.";
}
EXPECT_TRUE(status.isOk());
@@ -337,7 +336,7 @@
// Test with an empty vector of CoexUnsafeChannels.
std::vector<IWifiChip::CoexUnsafeChannel> vec;
- IWifiChip::CoexRestriction restrictions = static_cast<IWifiChip::CoexRestriction>(0);
+ int restrictions = 0;
auto status = wifi_chip_->setCoexUnsafeChannels(vec, restrictions);
if (!status.isOk()) {
EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED));
@@ -352,10 +351,9 @@
unsafeChannel5Ghz.band = WifiBand::BAND_5GHZ;
unsafeChannel5Ghz.channel = 36;
vec.push_back(unsafeChannel5Ghz);
- restrictions = static_cast<IWifiChip::CoexRestriction>(
- static_cast<int32_t>(IWifiChip::CoexRestriction::WIFI_AWARE) |
- static_cast<int32_t>(IWifiChip::CoexRestriction::SOFTAP) |
- static_cast<int32_t>(IWifiChip::CoexRestriction::WIFI_DIRECT));
+ restrictions = static_cast<int32_t>(IWifiChip::CoexRestriction::WIFI_AWARE) |
+ static_cast<int32_t>(IWifiChip::CoexRestriction::SOFTAP) |
+ static_cast<int32_t>(IWifiChip::CoexRestriction::WIFI_DIRECT);
status = wifi_chip_->setCoexUnsafeChannels(vec, restrictions);
if (!status.isOk()) {
diff --git a/wifi/aidl/vts/functional/wifi_sta_iface_aidl_test.cpp b/wifi/aidl/vts/functional/wifi_sta_iface_aidl_test.cpp
index fe32be5..b772bc3 100644
--- a/wifi/aidl/vts/functional/wifi_sta_iface_aidl_test.cpp
+++ b/wifi/aidl/vts/functional/wifi_sta_iface_aidl_test.cpp
@@ -54,9 +54,9 @@
protected:
bool isCapabilitySupported(IWifiStaIface::StaIfaceCapabilityMask expected) {
- IWifiStaIface::StaIfaceCapabilityMask caps = {};
+ int32_t caps = 0;
EXPECT_TRUE(wifi_sta_iface_->getCapabilities(&caps).isOk());
- return static_cast<uint32_t>(caps) & static_cast<uint32_t>(expected);
+ return caps & static_cast<int32_t>(expected);
}
ndk::ScopedAStatus createStaIface(std::shared_ptr<IWifiStaIface>* sta_iface) {
@@ -86,9 +86,9 @@
* GetCapabilities
*/
TEST_P(WifiStaIfaceAidlTest, GetCapabilities) {
- IWifiStaIface::StaIfaceCapabilityMask caps = {};
+ int32_t caps = 0;
EXPECT_TRUE(wifi_sta_iface_->getCapabilities(&caps).isOk());
- EXPECT_NE(static_cast<int32_t>(caps), 0);
+ EXPECT_NE(caps, 0);
}
/*