Merge "Revert "Add GPU enabled ADPF to V5 of power hal."" into main
diff --git a/audio/aidl/Android.bp b/audio/aidl/Android.bp
index 0ab990a..89d186c 100644
--- a/audio/aidl/Android.bp
+++ b/audio/aidl/Android.bp
@@ -297,6 +297,7 @@
"android/hardware/audio/effect/PresetReverb.aidl",
"android/hardware/audio/effect/Processing.aidl",
"android/hardware/audio/effect/Range.aidl",
+ "android/hardware/audio/effect/Spatializer.aidl",
"android/hardware/audio/effect/State.aidl",
"android/hardware/audio/effect/VendorExtension.aidl",
"android/hardware/audio/effect/Virtualizer.aidl",
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 0422bd9..7313b57 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
@@ -60,6 +60,7 @@
android.hardware.audio.effect.Visualizer.Id visualizerTag;
android.hardware.audio.effect.Volume.Id volumeTag;
android.hardware.audio.effect.Parameter.Tag commonTag;
+ android.hardware.audio.effect.Spatializer.Id spatializerTag;
}
@VintfStability
parcelable Common {
@@ -91,5 +92,6 @@
android.hardware.audio.effect.Virtualizer virtualizer;
android.hardware.audio.effect.Visualizer visualizer;
android.hardware.audio.effect.Volume volume;
+ android.hardware.audio.effect.Spatializer spatializer;
}
}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Range.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Range.aidl
index 93edc5e..40ee6b5 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Range.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Range.aidl
@@ -50,6 +50,7 @@
android.hardware.audio.effect.Range.VirtualizerRange[] virtualizer;
android.hardware.audio.effect.Range.VisualizerRange[] visualizer;
android.hardware.audio.effect.Range.VolumeRange[] volume;
+ android.hardware.audio.effect.Range.SpatializerRange[] spatializer;
@VintfStability
parcelable AcousticEchoCancelerRange {
android.hardware.audio.effect.AcousticEchoCanceler min;
@@ -111,6 +112,11 @@
android.hardware.audio.effect.PresetReverb max;
}
@VintfStability
+ parcelable SpatializerRange {
+ android.hardware.audio.effect.Spatializer min;
+ android.hardware.audio.effect.Spatializer max;
+ }
+ @VintfStability
parcelable VendorExtensionRange {
android.hardware.audio.effect.VendorExtension min;
android.hardware.audio.effect.VendorExtension max;
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Spatializer.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Spatializer.aidl
new file mode 100644
index 0000000..98ecee0
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Spatializer.aidl
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.audio.effect;
+@VintfStability
+union Spatializer {
+ android.hardware.audio.effect.VendorExtension vendor;
+ android.media.audio.common.AudioChannelLayout[] supportedChannelLayout;
+ android.media.audio.common.Spatialization.Level spatializationLevel;
+ android.media.audio.common.Spatialization.Mode spatializationMode;
+ int headTrackingSensorId;
+ android.media.audio.common.HeadTracking.Mode headTrackingMode;
+ android.media.audio.common.HeadTracking.ConnectionMode headTrackingConnectionMode;
+ android.media.audio.common.HeadTracking.SensorData headTrackingSensorData;
+ @VintfStability
+ union Id {
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
+ android.hardware.audio.effect.Spatializer.Tag commonTag;
+ }
+}
diff --git a/audio/aidl/android/hardware/audio/effect/Parameter.aidl b/audio/aidl/android/hardware/audio/effect/Parameter.aidl
index 0954055..6ec7226 100644
--- a/audio/aidl/android/hardware/audio/effect/Parameter.aidl
+++ b/audio/aidl/android/hardware/audio/effect/Parameter.aidl
@@ -28,6 +28,7 @@
import android.hardware.audio.effect.LoudnessEnhancer;
import android.hardware.audio.effect.NoiseSuppression;
import android.hardware.audio.effect.PresetReverb;
+import android.hardware.audio.effect.Spatializer;
import android.hardware.audio.effect.VendorExtension;
import android.hardware.audio.effect.Virtualizer;
import android.hardware.audio.effect.Visualizer;
@@ -103,6 +104,11 @@
* directly.
*/
Parameter.Tag commonTag;
+
+ /**
+ * Parameter tag defined for Spatializer parameters.
+ */
+ Spatializer.Id spatializerTag;
}
/**
@@ -189,6 +195,7 @@
Virtualizer virtualizer;
Visualizer visualizer;
Volume volume;
+ Spatializer spatializer;
}
Specific specific;
}
diff --git a/audio/aidl/android/hardware/audio/effect/Range.aidl b/audio/aidl/android/hardware/audio/effect/Range.aidl
index 567320a..e5acb68 100644
--- a/audio/aidl/android/hardware/audio/effect/Range.aidl
+++ b/audio/aidl/android/hardware/audio/effect/Range.aidl
@@ -28,6 +28,7 @@
import android.hardware.audio.effect.LoudnessEnhancer;
import android.hardware.audio.effect.NoiseSuppression;
import android.hardware.audio.effect.PresetReverb;
+import android.hardware.audio.effect.Spatializer;
import android.hardware.audio.effect.VendorExtension;
import android.hardware.audio.effect.Virtualizer;
import android.hardware.audio.effect.Visualizer;
@@ -169,6 +170,12 @@
}
@VintfStability
+ parcelable SpatializerRange {
+ Spatializer min;
+ Spatializer max;
+ }
+
+ @VintfStability
parcelable VendorExtensionRange {
VendorExtension min;
VendorExtension max;
@@ -217,4 +224,5 @@
VirtualizerRange[] virtualizer;
VisualizerRange[] visualizer;
VolumeRange[] volume;
+ SpatializerRange[] spatializer;
}
diff --git a/audio/aidl/android/hardware/audio/effect/Spatializer.aidl b/audio/aidl/android/hardware/audio/effect/Spatializer.aidl
new file mode 100644
index 0000000..6ebe0d5
--- /dev/null
+++ b/audio/aidl/android/hardware/audio/effect/Spatializer.aidl
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.audio.effect;
+
+import android.hardware.audio.effect.VendorExtension;
+import android.media.audio.common.AudioChannelLayout;
+import android.media.audio.common.HeadTracking;
+import android.media.audio.common.Spatialization;
+
+/**
+ * Union representing parameters for audio spatialization effects.
+ *
+ * Sound spatialization simulates sounds around the listener as if they were emanating from virtual
+ * positions based on the original recording.
+ * For more details, refer to the documentation:
+ * https://developer.android.com/reference/android/media/Spatializer.
+ *
+ * android.hardware.audio.effect.Spatializer specifies parameters for the implementation of audio
+ * spatialization effects.
+ *
+ * A Spatializer implementation must report its supported parameter ranges using Capability.Range.
+ * spatializer.
+ */
+@VintfStability
+union Spatializer {
+ /**
+ * Parameter tag to identify the parameters for getParameter().
+ */
+ @VintfStability
+ union Id {
+ VendorExtension vendorExtensionTag;
+ Spatializer.Tag commonTag;
+ }
+
+ /**
+ * Vendor extension implementation for additional parameters.
+ */
+ VendorExtension vendor;
+
+ /**
+ * List of supported input channel layouts.
+ */
+ AudioChannelLayout[] supportedChannelLayout;
+
+ /**
+ * Level of spatialization.
+ */
+ Spatialization.Level spatializationLevel;
+
+ /**
+ * Spatialization mode, Binaural or Transaural for example.
+ */
+ Spatialization.Mode spatializationMode;
+
+ /**
+ * Head tracking sensor ID.
+ */
+ int headTrackingSensorId;
+
+ /**
+ * Head tracking mode for spatialization.
+ */
+ HeadTracking.Mode headTrackingMode;
+
+ /**
+ * Head tracking sensor connection mode for spatialization.
+ */
+ HeadTracking.ConnectionMode headTrackingConnectionMode;
+
+ /**
+ * Headtracking sensor data.
+ */
+ HeadTracking.SensorData headTrackingSensorData;
+}
diff --git a/audio/aidl/common/include/Utils.h b/audio/aidl/common/include/Utils.h
index 59ca92a..ef312d5 100644
--- a/audio/aidl/common/include/Utils.h
+++ b/audio/aidl/common/include/Utils.h
@@ -175,7 +175,7 @@
}
constexpr int32_t frameCountFromDurationUs(long durationUs, int32_t sampleRateHz) {
- return (durationUs * sampleRateHz) / 1000000LL;
+ return (static_cast<long long>(durationUs) * sampleRateHz) / 1000000LL;
}
constexpr int32_t frameCountFromDurationMs(int32_t durationMs, int32_t sampleRateHz) {
diff --git a/audio/aidl/default/Configuration.cpp b/audio/aidl/default/Configuration.cpp
index d09552b..254eb46 100644
--- a/audio/aidl/default/Configuration.cpp
+++ b/audio/aidl/default/Configuration.cpp
@@ -302,8 +302,9 @@
// 2. The canonical r_submix configuration only lists 'STEREO' and '48000',
// however the framework attempts to open streams for other sample rates
// as well. The legacy r_submix implementation allowed that, but libaudiohal@aidl
-// will not find a mix port to use. Because of that, list all channel
-// masks and sample rates that the legacy implementation allowed.
+// will not find a mix port to use. Because of that, list all sample rates that
+// the legacy implementation allowed (note that mono was not allowed, the framework
+// is expected to upmix mono tracks into stereo if needed).
// 3. The legacy implementation had a hard limit on the number of routes (10),
// and this is checked indirectly by AudioPlaybackCaptureTest#testPlaybackCaptureDoS
// CTS test. Instead of hardcoding the number of routes, we can use
@@ -331,9 +332,8 @@
std::unique_ptr<Configuration> getRSubmixConfiguration() {
static const Configuration configuration = []() {
Configuration c;
- const std::vector<AudioProfile> standardPcmAudioProfiles{
- createProfile(PcmType::INT_16_BIT,
- {AudioChannelLayout::LAYOUT_MONO, AudioChannelLayout::LAYOUT_STEREO},
+ const std::vector<AudioProfile> remoteSubmixPcmAudioProfiles{
+ createProfile(PcmType::INT_16_BIT, {AudioChannelLayout::LAYOUT_STEREO},
{8000, 11025, 16000, 32000, 44100, 48000})};
// Device ports
@@ -343,25 +343,25 @@
createDeviceExt(AudioDeviceType::OUT_SUBMIX, 0,
AudioDeviceDescription::CONNECTION_VIRTUAL));
c.ports.push_back(rsubmixOutDevice);
- c.connectedProfiles[rsubmixOutDevice.id] = standardPcmAudioProfiles;
+ c.connectedProfiles[rsubmixOutDevice.id] = remoteSubmixPcmAudioProfiles;
AudioPort rsubmixInDevice =
createPort(c.nextPortId++, "Remote Submix In", 0, true,
createDeviceExt(AudioDeviceType::IN_SUBMIX, 0,
AudioDeviceDescription::CONNECTION_VIRTUAL));
c.ports.push_back(rsubmixInDevice);
- c.connectedProfiles[rsubmixInDevice.id] = standardPcmAudioProfiles;
+ c.connectedProfiles[rsubmixInDevice.id] = remoteSubmixPcmAudioProfiles;
// Mix ports
AudioPort rsubmixOutMix =
createPort(c.nextPortId++, "r_submix output", 0, false, createPortMixExt(20, 10));
- rsubmixOutMix.profiles = standardPcmAudioProfiles;
+ rsubmixOutMix.profiles = remoteSubmixPcmAudioProfiles;
c.ports.push_back(rsubmixOutMix);
AudioPort rsubmixInMix =
createPort(c.nextPortId++, "r_submix input", 0, true, createPortMixExt(20, 10));
- rsubmixInMix.profiles = standardPcmAudioProfiles;
+ rsubmixInMix.profiles = remoteSubmixPcmAudioProfiles;
c.ports.push_back(rsubmixInMix);
c.routes.push_back(createRoute({rsubmixOutMix}, rsubmixOutDevice));
diff --git a/audio/aidl/default/r_submix/StreamRemoteSubmix.cpp b/audio/aidl/default/r_submix/StreamRemoteSubmix.cpp
index 38281b9..fc61dcb 100644
--- a/audio/aidl/default/r_submix/StreamRemoteSubmix.cpp
+++ b/audio/aidl/default/r_submix/StreamRemoteSubmix.cpp
@@ -131,6 +131,8 @@
LOG(DEBUG) << __func__ << ": shutting down MonoPipe sink";
sink->shutdown(true);
+ // The client already considers this stream as closed, release the output end.
+ route->closeStream(mIsInput);
} else {
LOG(DEBUG) << __func__ << ": stream already closed.";
ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
diff --git a/audio/aidl/vts/ModuleConfig.cpp b/audio/aidl/vts/ModuleConfig.cpp
index a633d83..2b86271 100644
--- a/audio/aidl/vts/ModuleConfig.cpp
+++ b/audio/aidl/vts/ModuleConfig.cpp
@@ -17,6 +17,9 @@
#include <algorithm>
#include <chrono>
+#define LOG_TAG "VtsHalAudio.ModuleConfig"
+#include <android-base/logging.h>
+
#include <Utils.h>
#include <aidl/android/media/audio/common/AudioInputFlags.h>
#include <aidl/android/media/audio/common/AudioIoFlags.h>
diff --git a/automotive/can/1.0/default/tests/fuzzer/AutomotiveCanV1_0Fuzzer.cpp b/automotive/can/1.0/default/tests/fuzzer/AutomotiveCanV1_0Fuzzer.cpp
index 96110db..e882160 100644
--- a/automotive/can/1.0/default/tests/fuzzer/AutomotiveCanV1_0Fuzzer.cpp
+++ b/automotive/can/1.0/default/tests/fuzzer/AutomotiveCanV1_0Fuzzer.cpp
@@ -18,9 +18,9 @@
namespace android::hardware::automotive::can::V1_0::implementation::fuzzer {
-constexpr CanController::InterfaceType kInterfaceType[] = {CanController::InterfaceType::VIRTUAL,
- CanController::InterfaceType::SOCKETCAN,
- CanController::InterfaceType::SLCAN};
+constexpr CanController::InterfaceType kInterfaceType[] = {
+ CanController::InterfaceType::VIRTUAL, CanController::InterfaceType::SOCKETCAN,
+ CanController::InterfaceType::SLCAN, CanController::InterfaceType::INDEXED};
constexpr FilterFlag kFilterFlag[] = {FilterFlag::DONT_CARE, FilterFlag::SET, FilterFlag::NOT_SET};
constexpr size_t kInterfaceTypeLength = std::size(kInterfaceType);
constexpr size_t kFilterFlagLength = std::size(kFilterFlag);
@@ -28,8 +28,8 @@
constexpr size_t kMaxPayloadBytes = 64;
constexpr size_t kMaxFilters = 20;
constexpr size_t kMaxSerialNumber = 1000;
-constexpr size_t kMaxBuses = 10;
-constexpr size_t kMaxRepeat = 5;
+constexpr size_t kMaxBuses = 100;
+constexpr size_t kMaxRepeat = 100;
Bus CanFuzzer::makeBus() {
ICanController::BusConfig config = {};
@@ -56,9 +56,13 @@
}
void CanFuzzer::invokeUpInterface() {
- const CanController::InterfaceType iftype =
- kInterfaceType[mFuzzedDataProvider->ConsumeIntegralInRange<size_t>(
- 0, kInterfaceTypeLength - 1)];
+ CanController::InterfaceType controller;
+ if (mFuzzedDataProvider->ConsumeBool()) {
+ controller = (CanController::InterfaceType)mFuzzedDataProvider->ConsumeIntegral<uint8_t>();
+ } else {
+ controller = kInterfaceType[mFuzzedDataProvider->ConsumeIntegralInRange<size_t>(
+ 0, kInterfaceTypeLength - 1)];
+ }
std::string configName;
if (const bool shouldInvokeValidBus = mFuzzedDataProvider->ConsumeBool();
@@ -73,7 +77,7 @@
ICanController::BusConfig config = {.name = configName};
- if (iftype == CanController::InterfaceType::SOCKETCAN) {
+ if (controller == CanController::InterfaceType::SOCKETCAN) {
CanController::BusConfig::InterfaceId::Socketcan socketcan = {};
if (const bool shouldPassSerialSocket = mFuzzedDataProvider->ConsumeBool();
shouldPassSerialSocket) {
@@ -83,7 +87,7 @@
socketcan.ifname(ifname);
}
config.interfaceId.socketcan(socketcan);
- } else if (iftype == CanController::InterfaceType::SLCAN) {
+ } else if (controller == CanController::InterfaceType::SLCAN) {
CanController::BusConfig::InterfaceId::Slcan slcan = {};
if (const bool shouldPassSerialSlcan = mFuzzedDataProvider->ConsumeBool();
shouldPassSerialSlcan) {
@@ -93,8 +97,12 @@
slcan.ttyname(ifname);
}
config.interfaceId.slcan(slcan);
- } else if (iftype == CanController::InterfaceType::VIRTUAL) {
+ } else if (controller == CanController::InterfaceType::VIRTUAL) {
config.interfaceId.virtualif({ifname});
+ } else if (controller == CanController::InterfaceType::INDEXED) {
+ CanController::BusConfig::InterfaceId::Indexed indexed;
+ indexed.index = mFuzzedDataProvider->ConsumeIntegral<uint8_t>();
+ config.interfaceId.indexed(indexed);
}
const size_t numInvocations =
@@ -108,8 +116,13 @@
hidl_string configName;
if (const bool shouldInvokeValidBus = mFuzzedDataProvider->ConsumeBool();
(shouldInvokeValidBus) && (mBusNames.size() > 0)) {
- const size_t busNameIndex =
- mFuzzedDataProvider->ConsumeIntegralInRange<size_t>(0, mBusNames.size() - 1);
+ size_t busNameIndex;
+ if (mBusNames.size() == 1) {
+ busNameIndex = 0;
+ } else {
+ busNameIndex =
+ mFuzzedDataProvider->ConsumeIntegralInRange<size_t>(0, mBusNames.size() - 1);
+ }
configName = mBusNames[busNameIndex];
} else {
configName = mFuzzedDataProvider->ConsumeRandomLengthString(kMaxCharacters);
@@ -122,12 +135,6 @@
}
}
-void CanFuzzer::invokeController() {
- getSupportedInterfaceTypes();
- invokeUpInterface();
- invokeDownInterface();
-}
-
void CanFuzzer::invokeBus() {
const size_t numBuses = mFuzzedDataProvider->ConsumeIntegralInRange<size_t>(1, kMaxBuses);
for (size_t i = 0; i < numBuses; ++i) {
@@ -152,12 +159,22 @@
for (uint32_t k = 0; k < numFilters; ++k) {
filterVector[k].id = mFuzzedDataProvider->ConsumeIntegral<uint32_t>();
filterVector[k].mask = mFuzzedDataProvider->ConsumeIntegral<uint32_t>();
- filterVector[k].rtr =
- kFilterFlag[mFuzzedDataProvider->ConsumeIntegralInRange<size_t>(
- 0, kFilterFlagLength - 1)];
- filterVector[k].extendedFormat =
- kFilterFlag[mFuzzedDataProvider->ConsumeIntegralInRange<size_t>(
- 0, kFilterFlagLength - 1)];
+ if (mFuzzedDataProvider->ConsumeBool()) {
+ filterVector[k].rtr =
+ (FilterFlag)mFuzzedDataProvider->ConsumeIntegral<uint8_t>();
+ } else {
+ filterVector[k].rtr =
+ kFilterFlag[mFuzzedDataProvider->ConsumeIntegralInRange<size_t>(
+ 0, kFilterFlagLength - 1)];
+ }
+ if (mFuzzedDataProvider->ConsumeBool()) {
+ filterVector[k].extendedFormat =
+ (FilterFlag)mFuzzedDataProvider->ConsumeIntegral<uint8_t>();
+ } else {
+ filterVector[k].extendedFormat =
+ kFilterFlag[mFuzzedDataProvider->ConsumeIntegralInRange<size_t>(
+ 0, kFilterFlagLength - 1)];
+ }
filterVector[k].exclude = mFuzzedDataProvider->ConsumeBool();
}
auto listener = listeningBus.listen(filterVector);
@@ -175,8 +192,16 @@
void CanFuzzer::process(const uint8_t* data, size_t size) {
mFuzzedDataProvider = new FuzzedDataProvider(data, size);
- invokeController();
- invokeBus();
+ while (mFuzzedDataProvider->remaining_bytes()) {
+ auto CanFuzzerFunction =
+ mFuzzedDataProvider->PickValueInArray<const std::function<void()>>({
+ [&]() { getSupportedInterfaceTypes(); },
+ [&]() { invokeUpInterface(); },
+ [&]() { invokeDownInterface(); },
+ [&]() { invokeBus(); },
+ });
+ CanFuzzerFunction();
+ }
}
bool CanFuzzer::init() {
diff --git a/automotive/can/1.0/default/tests/fuzzer/AutomotiveCanV1_0Fuzzer.h b/automotive/can/1.0/default/tests/fuzzer/AutomotiveCanV1_0Fuzzer.h
index 930cddd..3211bd0 100644
--- a/automotive/can/1.0/default/tests/fuzzer/AutomotiveCanV1_0Fuzzer.h
+++ b/automotive/can/1.0/default/tests/fuzzer/AutomotiveCanV1_0Fuzzer.h
@@ -116,7 +116,6 @@
hidl_vec<hidl_string> getBusNames();
void getSupportedInterfaceTypes();
void invokeBus();
- void invokeController();
void invokeUpInterface();
void invokeDownInterface();
FuzzedDataProvider* mFuzzedDataProvider = nullptr;
diff --git a/automotive/vehicle/2.0/default/tests/fuzzer/VehicleManager_fuzzer.cpp b/automotive/vehicle/2.0/default/tests/fuzzer/VehicleManager_fuzzer.cpp
index 8a085e5..4d0995d 100644
--- a/automotive/vehicle/2.0/default/tests/fuzzer/VehicleManager_fuzzer.cpp
+++ b/automotive/vehicle/2.0/default/tests/fuzzer/VehicleManager_fuzzer.cpp
@@ -76,30 +76,20 @@
using ::android::hardware::automotive::vehicle::V2_0::vms::VmsLayerOffering;
using ::android::hardware::automotive::vehicle::V2_0::vms::VmsOffers;
-constexpr const char kCarMake[] = "Default Car";
-constexpr VehicleProperty kVehicleProp[] = {VehicleProperty::INVALID,
- VehicleProperty::HVAC_FAN_SPEED,
- VehicleProperty::INFO_MAKE,
- VehicleProperty::DISPLAY_BRIGHTNESS,
- VehicleProperty::INFO_FUEL_CAPACITY,
- VehicleProperty::HVAC_SEAT_TEMPERATURE};
-constexpr DiagnosticIntegerSensorIndex kDiagnosticIntIndex[] = {
- DiagnosticIntegerSensorIndex::FUEL_SYSTEM_STATUS,
- DiagnosticIntegerSensorIndex::MALFUNCTION_INDICATOR_LIGHT_ON,
- DiagnosticIntegerSensorIndex::NUM_OXYGEN_SENSORS_PRESENT,
- DiagnosticIntegerSensorIndex::FUEL_TYPE};
-constexpr DiagnosticFloatSensorIndex kDiagnosticFloatIndex[] = {
- DiagnosticFloatSensorIndex::CALCULATED_ENGINE_LOAD,
- DiagnosticFloatSensorIndex::SHORT_TERM_FUEL_TRIM_BANK1,
- DiagnosticFloatSensorIndex::LONG_TERM_FUEL_TRIM_BANK1,
- DiagnosticFloatSensorIndex::THROTTLE_POSITION};
-constexpr size_t kVehiclePropArrayLength = std::size(kVehicleProp);
-constexpr size_t kIntSensorArrayLength = std::size(kDiagnosticIntIndex);
-constexpr size_t kFloatSensorArrayLength = std::size(kDiagnosticFloatIndex);
-constexpr VmsMessageType kAvailabilityMessageType[] = {VmsMessageType::AVAILABILITY_CHANGE,
- VmsMessageType::AVAILABILITY_RESPONSE};
-constexpr VmsMessageType kSubscriptionMessageType[] = {VmsMessageType::SUBSCRIPTIONS_CHANGE,
- VmsMessageType::SUBSCRIPTIONS_RESPONSE};
+std::string kCarMake;
+constexpr int32_t kMaxCaseMessage = 8;
+constexpr int32_t kMaxRuns = 20;
+constexpr int32_t kMaxSize = 1000;
+constexpr int32_t kMinSize = 0;
+constexpr int32_t kMaxFileSize = 100;
+float kFloatValue;
+std::vector<int32_t> kVec32;
+std::vector<int64_t> kVec64;
+std::vector<uint8_t> kVec8;
+std::vector<float> kVecFloat;
+static const std::vector<std::string> kSampleDtcs = {"P0070",
+ "P0102"
+ "P0123"};
MockedVehicleHal::VehiclePropValuePtr MockedVehicleHal::get(
const VehiclePropValue& requestedPropValue, StatusCode* outStatus) {
@@ -113,23 +103,23 @@
switch (property) {
case VehicleProperty::INFO_MAKE:
- pValue = getValuePool()->obtainString(kCarMake);
+ pValue = getValuePool()->obtainString(kCarMake.c_str());
break;
case VehicleProperty::INFO_FUEL_CAPACITY:
if (mFuelCapacityAttemptsLeft-- > 0) {
*outStatus = StatusCode::TRY_AGAIN;
} else {
- pValue = getValuePool()->obtainFloat(42.42);
+ pValue = getValuePool()->obtainFloat(kFloatValue);
}
break;
default:
if (requestedPropValue.prop == kCustomComplexProperty) {
pValue = getValuePool()->obtainComplex();
- pValue->value.int32Values = hidl_vec<int32_t>{10, 20};
- pValue->value.int64Values = hidl_vec<int64_t>{30, 40};
- pValue->value.floatValues = hidl_vec<float_t>{1.1, 2.2};
- pValue->value.bytes = hidl_vec<uint8_t>{1, 2, 3};
- pValue->value.stringValue = kCarMake;
+ pValue->value.int32Values = hidl_vec<int32_t>{kVec32};
+ pValue->value.int64Values = hidl_vec<int64_t>{kVec64};
+ pValue->value.floatValues = hidl_vec<float_t>{kVecFloat};
+ pValue->value.bytes = hidl_vec<uint8_t>{kVec8};
+ pValue->value.stringValue = kCarMake.c_str();
break;
}
auto key = makeKey(toInt(property), areaId);
@@ -145,28 +135,72 @@
return pValue;
}
+void VehicleHalManagerFuzzer::initValue() {
+ kCarMake = mFuzzedDataProvider->ConsumeRandomLengthString(kMaxFileSize);
+ kFloatValue = mFuzzedDataProvider->ConsumeFloatingPoint<float>();
+ fillParameter<int32_t>(mFuzzedDataProvider->ConsumeIntegralInRange<size_t>(kMinSize, kMaxSize),
+ kVec32);
+ fillParameter<int64_t>(mFuzzedDataProvider->ConsumeIntegralInRange<size_t>(kMinSize, kMaxSize),
+ kVec64);
+ fillParameter<uint8_t>(mFuzzedDataProvider->ConsumeIntegralInRange<size_t>(kMinSize, kMaxSize),
+ kVec8);
+ size_t size = mFuzzedDataProvider->ConsumeIntegralInRange<size_t>(kMinSize, kMaxSize);
+ for (size_t i = 0; i < size; ++i) {
+ kVecFloat.push_back(mFuzzedDataProvider->ConsumeFloatingPoint<float>());
+ }
+}
+
void VehicleHalManagerFuzzer::process(const uint8_t* data, size_t size) {
mFuzzedDataProvider = new FuzzedDataProvider(data, size);
- invokeDebug();
- invokePropConfigs();
- invokeSubscribe();
- invokeSetAndGetValues();
- invokeObd2SensorStore();
- invokeVmsUtils();
- invokeVehiclePropStore();
- invokeWatchDogClient();
+ initValue();
+ /* Limited while loop runs to prevent timeouts caused
+ * by repeated calls to high-execution-time APIs.
+ */
+ size_t maxRuns = mFuzzedDataProvider->ConsumeIntegralInRange<size_t>(kMinSize, kMaxRuns);
+ size_t itr = 0;
+ while (mFuzzedDataProvider->remaining_bytes() && ++itr <= maxRuns) {
+ auto invokeVehicleHalManagerFuzzer =
+ mFuzzedDataProvider->PickValueInArray<const std::function<void()>>({
+ [&]() { invokeDebug(); },
+ [&]() { invokePropConfigs(); },
+ [&]() { invokeSubscribe(); },
+ [&]() { invokeSetAndGetValues(); },
+ [&]() { invokeObd2SensorStore(); },
+ [&]() { invokeVmsUtils(); },
+ [&]() { invokeVehiclePropStore(); },
+ [&]() { invokeWatchDogClient(); },
+ });
+ invokeVehicleHalManagerFuzzer();
+ }
}
void VehicleHalManagerFuzzer::invokeDebug() {
- hidl_string debugOption = mFuzzedDataProvider->PickValueInArray(
- {"--help", "--list", "--get", "--set", "", "invalid"});
hidl_handle fd = {};
native_handle_t* rawHandle = native_handle_create(/*numFds=*/1, /*numInts=*/0);
fd.setTo(native_handle_clone(rawHandle), /*shouldOwn=*/true);
+ int32_t size = mFuzzedDataProvider->ConsumeIntegralInRange<int32_t>(kMinSize, kMaxFileSize);
+ hidl_vec<hidl_string> options(size);
- mManager->debug(fd, {});
- mManager->debug(fd, {debugOption});
+ for (int32_t idx = 0; idx < size; ++idx) {
+ if (idx == 0 && mFuzzedDataProvider->ConsumeBool()) {
+ options[idx] = mFuzzedDataProvider->PickValueInArray(
+ {"--help", "--list", "--get", "--set", "", "invalid"});
+ } else if (idx == 2 && mFuzzedDataProvider->ConsumeBool()) {
+ options[idx] =
+ mFuzzedDataProvider->PickValueInArray({"-i", "-i64", "-f", "-s", "-b", "-a"});
+ } else if (mFuzzedDataProvider->ConsumeBool()) {
+ options[idx] = mFuzzedDataProvider->ConsumeRandomLengthString(kMaxSize);
+ } else {
+ options[idx] = std::to_string(mFuzzedDataProvider->ConsumeIntegral<int32_t>());
+ }
+ }
+
+ if (mFuzzedDataProvider->ConsumeBool()) {
+ mManager->debug(fd, {});
+ } else {
+ mManager->debug(fd, options);
+ }
native_handle_delete(rawHandle);
}
@@ -175,178 +209,245 @@
int32_t vehicleProp2 = mFuzzedDataProvider->ConsumeIntegral<int32_t>();
hidl_vec<int32_t> properties = {vehicleProp1, vehicleProp2};
+ auto invokePropConfigsAPI = mFuzzedDataProvider->PickValueInArray<const std::function<void()>>({
+ [&]() {
+ mManager->getPropConfigs(
+ properties, []([[maybe_unused]] StatusCode status,
+ [[maybe_unused]] const hidl_vec<VehiclePropConfig>& c) {});
+ },
+ [&]() {
+ mManager->getPropConfigs(
+ {mFuzzedDataProvider->ConsumeIntegral<int32_t>()},
+ []([[maybe_unused]] StatusCode status,
+ [[maybe_unused]] const hidl_vec<VehiclePropConfig>& c) {});
+ },
+ [&]() {
+ mManager->getAllPropConfigs(
+ []([[maybe_unused]] const hidl_vec<VehiclePropConfig>& propConfigs) {});
+ },
- mManager->getPropConfigs(properties,
- []([[maybe_unused]] StatusCode status,
- [[maybe_unused]] const hidl_vec<VehiclePropConfig>& c) {});
-
- mManager->getPropConfigs({toInt(kVehicleProp[abs(vehicleProp1) % kVehiclePropArrayLength])},
- []([[maybe_unused]] StatusCode status,
- [[maybe_unused]] const hidl_vec<VehiclePropConfig>& c) {});
-
- mManager->getAllPropConfigs(
- []([[maybe_unused]] const hidl_vec<VehiclePropConfig>& propConfigs) {});
+ });
+ invokePropConfigsAPI();
}
void VehicleHalManagerFuzzer::invokeSubscribe() {
- int32_t vehicleProp1 = mFuzzedDataProvider->ConsumeIntegral<int32_t>();
int32_t vehicleProp2 = mFuzzedDataProvider->ConsumeIntegral<int32_t>();
int32_t vehicleProp3 = mFuzzedDataProvider->ConsumeIntegral<int32_t>();
- const auto prop1 = toInt(kVehicleProp[abs(vehicleProp1) % kVehiclePropArrayLength]);
sp<MockedVehicleCallback> cb = new MockedVehicleCallback();
+ VehiclePropertyType type =
+ static_cast<VehiclePropertyType>(mFuzzedDataProvider->ConsumeIntegral<int32_t>());
- hidl_vec<SubscribeOptions> options = {
- SubscribeOptions{.propId = prop1, .flags = SubscribeFlags::EVENTS_FROM_CAR}};
+ auto invokeSubscribeAPI = mFuzzedDataProvider->PickValueInArray<const std::function<void()>>({
+ [&]() {
+ size_t size =
+ mFuzzedDataProvider->ConsumeIntegralInRange<size_t>(kMinSize, kMaxSize);
+ hidl_vec<SubscribeOptions> options(size);
+ for (size_t idx = 0; idx < size; ++idx) {
+ options[idx] = {SubscribeOptions{
+ .propId = mFuzzedDataProvider->ConsumeIntegral<int32_t>(),
+ .flags = static_cast<SubscribeFlags>(
+ mFuzzedDataProvider->ConsumeIntegral<int32_t>())}};
+ }
+ mManager->subscribe(cb, options);
+ },
+ [&]() {
+ auto unsubscribedValue = mObjectPool->obtain(type);
+ if (!unsubscribedValue) {
+ return;
+ }
+ unsubscribedValue->prop = vehicleProp2;
+ unsubscribedValue->value.int32Values[0] = INT32_MAX;
+ mHal->sendPropEvent(std::move(unsubscribedValue));
+ cb->waitForExpectedEvents(mFuzzedDataProvider->ConsumeIntegral<size_t>());
+ },
+ [&]() {
+ const auto prop1 = mFuzzedDataProvider->ConsumeIntegral<int32_t>();
+ mManager->unsubscribe(cb, prop1);
+ },
+ [&]() {
+ mHal->sendHalError(StatusCode::TRY_AGAIN, vehicleProp3,
+ mFuzzedDataProvider->ConsumeIntegral<int32_t>() /*areaId=*/);
+ },
- mManager->subscribe(cb, options);
-
- auto unsubscribedValue = mObjectPool->obtain(VehiclePropertyType::INT32);
- unsubscribedValue->prop = toInt(kVehicleProp[abs(vehicleProp2) % kVehiclePropArrayLength]);
-
- mHal->sendPropEvent(std::move(unsubscribedValue));
- cb->getReceivedEvents();
- cb->waitForExpectedEvents(0);
-
- auto subscribedValue = mObjectPool->obtain(VehiclePropertyType::INT32);
- subscribedValue->prop = toInt(kVehicleProp[abs(vehicleProp2) % kVehiclePropArrayLength]);
- subscribedValue->value.int32Values[0] = INT32_MAX;
-
- cb->reset();
- VehiclePropValue actualValue(*subscribedValue.get());
- mHal->sendPropEvent(std::move(subscribedValue));
- cb->waitForExpectedEvents(1);
- mManager->unsubscribe(cb, prop1);
-
- sp<MockedVehicleCallback> cb2 = new MockedVehicleCallback();
-
- hidl_vec<SubscribeOptions> options2 = {
- SubscribeOptions{
- .propId = toInt(kVehicleProp[abs(vehicleProp3) % kVehiclePropArrayLength]),
- .flags = SubscribeFlags::EVENTS_FROM_CAR},
- };
-
- mManager->subscribe(cb2, options2);
-
- mHal->sendHalError(StatusCode::TRY_AGAIN,
- toInt(kVehicleProp[abs(vehicleProp3) % kVehiclePropArrayLength]),
- /*areaId=*/0);
+ });
+ invokeSubscribeAPI();
}
void VehicleHalManagerFuzzer::invokeSetAndGetValues() {
- uint32_t vehicleProp1 =
- mFuzzedDataProvider->ConsumeIntegralInRange<uint32_t>(0, kVehiclePropArrayLength - 1);
- uint32_t vehicleProp2 =
- mFuzzedDataProvider->ConsumeIntegralInRange<uint32_t>(0, kVehiclePropArrayLength - 1);
- uint32_t vehicleProp3 =
- mFuzzedDataProvider->ConsumeIntegralInRange<uint32_t>(0, kVehiclePropArrayLength - 1);
-
- invokeGet(kCustomComplexProperty, 0);
- invokeGet(toInt(kVehicleProp[vehicleProp2]), 0);
- invokeGet(toInt(kVehicleProp[vehicleProp1]), 0);
-
- auto expectedValue = mObjectPool->obtainInt32(mFuzzedDataProvider->ConsumeIntegral<int32_t>());
- mObjectPool->obtainInt64(mFuzzedDataProvider->ConsumeIntegral<int64_t>());
- mObjectPool->obtainFloat(mFuzzedDataProvider->ConsumeFloatingPoint<float>());
- mObjectPool->obtainBoolean(mFuzzedDataProvider->ConsumeBool());
- expectedValue->prop = toInt(kVehicleProp[vehicleProp2]);
- expectedValue->areaId = 0;
-
- mManager->set(*expectedValue.get());
- invokeGet(toInt(kVehicleProp[vehicleProp2]), 0);
- expectedValue->prop = toInt(kVehicleProp[vehicleProp3]);
- mManager->set(*expectedValue.get());
- expectedValue->prop = toInt(VehicleProperty::INVALID);
- mManager->set(*expectedValue.get());
+ auto invokeSetAndGetAPI = mFuzzedDataProvider->PickValueInArray<const std::function<void()>>({
+ [&]() {
+ invokeGet(mFuzzedDataProvider->ConsumeIntegral<int32_t>(),
+ mFuzzedDataProvider->ConsumeIntegral<int32_t>());
+ },
+ [&]() { mObjectPool->obtainInt64(mFuzzedDataProvider->ConsumeIntegral<int64_t>()); },
+ [&]() { mObjectPool->obtainFloat(mFuzzedDataProvider->ConsumeFloatingPoint<float>()); },
+ [&]() { mObjectPool->obtainBoolean(mFuzzedDataProvider->ConsumeBool()); },
+ [&]() {
+ int32_t vehicleProp2 = mFuzzedDataProvider->ConsumeIntegral<int32_t>();
+ auto expectedValue =
+ mObjectPool->obtainInt32(mFuzzedDataProvider->ConsumeIntegral<int32_t>());
+ expectedValue->prop = vehicleProp2;
+ expectedValue->areaId = mFuzzedDataProvider->ConsumeIntegral<int32_t>();
+ mManager->set(*expectedValue.get());
+ },
+ });
+ invokeSetAndGetAPI();
}
void VehicleHalManagerFuzzer::invokeObd2SensorStore() {
- uint32_t diagnosticIntIndex =
- mFuzzedDataProvider->ConsumeIntegralInRange<uint32_t>(0, kIntSensorArrayLength - 1);
- int32_t diagnosticIntValue = mFuzzedDataProvider->ConsumeIntegral<int32_t>();
- uint32_t diagnosticFloatIndex =
- mFuzzedDataProvider->ConsumeIntegralInRange<uint32_t>(0, kFloatSensorArrayLength - 1);
- float diagnosticFloatValue = mFuzzedDataProvider->ConsumeFloatingPoint<float>();
+ size_t diagnosticInt = mFuzzedDataProvider->ConsumeIntegralInRange<size_t>(kMinSize, kMaxSize);
+ size_t diagnosticFloat =
+ mFuzzedDataProvider->ConsumeIntegralInRange<size_t>(kMinSize, kMaxSize);
std::unique_ptr<Obd2SensorStore> sensorStore(
- new Obd2SensorStore(kIntSensorArrayLength, kFloatSensorArrayLength));
- if (sensorStore) {
- sensorStore->setIntegerSensor(kDiagnosticIntIndex[diagnosticIntIndex], diagnosticIntValue);
- sensorStore->setFloatSensor(kDiagnosticFloatIndex[diagnosticFloatIndex],
- diagnosticFloatValue);
- sensorStore->getIntegerSensors();
- sensorStore->getFloatSensors();
- sensorStore->getSensorsBitmask();
- static std::vector<std::string> sampleDtcs = {"P0070",
- "P0102"
- "P0123"};
- for (auto&& dtc : sampleDtcs) {
- auto freezeFrame = createVehiclePropValue(VehiclePropertyType::MIXED, 0);
- sensorStore->fillPropValue(dtc, freezeFrame.get());
- freezeFrame->prop = static_cast<int>(VehicleProperty::OBD2_FREEZE_FRAME);
- }
+ new Obd2SensorStore(diagnosticInt, diagnosticFloat));
+
+ if (!sensorStore.get()) {
+ return;
}
+
+ auto invokeObd2SensorStoreAPI =
+ mFuzzedDataProvider->PickValueInArray<const std::function<void()>>({
+ [&]() {
+ int32_t diagnosticIntValue =
+ mFuzzedDataProvider->ConsumeIntegral<int32_t>();
+ int32_t diagnosticIntIndex =
+ mFuzzedDataProvider->ConsumeIntegralInRange<int32_t>(
+ kMinSize,
+ toInt(DiagnosticIntegerSensorIndex::LAST_SYSTEM_INDEX) +
+ diagnosticInt);
+ sensorStore->setIntegerSensor(
+ static_cast<DiagnosticIntegerSensorIndex>(diagnosticIntIndex),
+ diagnosticIntValue);
+ },
+ [&]() {
+ float diagnosticFloatValue =
+ mFuzzedDataProvider->ConsumeFloatingPoint<float>();
+ int32_t diagnosticFloatIndex =
+ mFuzzedDataProvider->ConsumeIntegralInRange<int32_t>(
+ kMinSize,
+ toInt(DiagnosticFloatSensorIndex::LAST_SYSTEM_INDEX) +
+ diagnosticFloat);
+ sensorStore->setFloatSensor(
+ static_cast<DiagnosticFloatSensorIndex>(diagnosticFloatIndex),
+ diagnosticFloatValue);
+ },
+ [&]() { sensorStore->getIntegerSensors(); },
+ [&]() { sensorStore->getFloatSensors(); },
+ [&]() { sensorStore->getSensorsBitmask(); },
+ [&]() {
+ for (auto&& dtc : kSampleDtcs) {
+ VehiclePropertyType type = static_cast<VehiclePropertyType>(
+ mFuzzedDataProvider->ConsumeIntegral<int32_t>());
+ auto freezeFrame = createVehiclePropValue(
+ type, mFuzzedDataProvider->ConsumeIntegralInRange<int32_t>(
+ kMinSize, kMaxSize));
+ if (!freezeFrame.get()) {
+ return;
+ }
+ freezeFrame->prop = mFuzzedDataProvider->ConsumeIntegral<int32_t>();
+ sensorStore->fillPropValue(dtc, freezeFrame.get());
+ }
+ },
+ });
+ invokeObd2SensorStoreAPI();
}
void VehicleHalManagerFuzzer::invokeVmsUtils() {
- bool availabilityMsgType = mFuzzedDataProvider->ConsumeBool();
- bool subscriptionMsgType = mFuzzedDataProvider->ConsumeBool();
+ std::unique_ptr<VehiclePropValue> message;
int32_t intValue = mFuzzedDataProvider->ConsumeIntegral<int32_t>();
+ VmsLayer layer(mFuzzedDataProvider->ConsumeIntegral<int32_t>(),
+ mFuzzedDataProvider->ConsumeIntegral<int32_t>(),
+ mFuzzedDataProvider->ConsumeIntegral<int32_t>());
+ VmsOffers offers = {
+ intValue,
+ {VmsLayerOffering(VmsLayer(mFuzzedDataProvider->ConsumeIntegral<int32_t>(),
+ mFuzzedDataProvider->ConsumeIntegral<int32_t>(),
+ mFuzzedDataProvider->ConsumeIntegral<int32_t>()))}};
+ const VmsLayerAndPublisher layer_and_publisher(
+ VmsLayer(mFuzzedDataProvider->ConsumeIntegral<int32_t>(),
+ mFuzzedDataProvider->ConsumeIntegral<int32_t>(),
+ mFuzzedDataProvider->ConsumeIntegral<int32_t>()),
+ intValue);
- VmsLayer layer(1, 0, 2);
- auto message = createSubscribeMessage(layer);
+ switch (mFuzzedDataProvider->ConsumeIntegralInRange<int32_t>(kMinSize, kMaxCaseMessage)) {
+ case 0: {
+ message = createSubscribeMessage(layer);
+ break;
+ }
+ case 1: {
+ message = createUnsubscribeMessage(layer);
+ break;
+ }
+ case 2: {
+ message = createSubscriptionsRequest();
+ break;
+ }
+ case 3: {
+ message = createOfferingMessage(offers);
+ break;
+ }
+ case 4: {
+ message = createAvailabilityRequest();
+ break;
+ }
+ case 5: {
+ std::string pub_bytes;
+ if (mFuzzedDataProvider->ConsumeBool()) {
+ pub_bytes = "pub_id";
+ } else {
+ pub_bytes = mFuzzedDataProvider->ConsumeRandomLengthString(kMaxFileSize);
+ }
+ message = createPublisherIdRequest(pub_bytes);
+ break;
+ }
+ case 6: {
+ std::string bytes = "placeholder";
+ if (mFuzzedDataProvider->ConsumeBool()) {
+ bytes = "placeholder";
+ } else {
+ bytes = mFuzzedDataProvider->ConsumeRandomLengthString(kMaxFileSize);
+ }
+ message = createDataMessageWithLayerPublisherInfo(layer_and_publisher, bytes);
+ break;
+ }
+ case 7: {
+ message = createBaseVmsMessage(
+ mFuzzedDataProvider->ConsumeIntegralInRange<size_t>(kMinSize, kMaxSize));
+ break;
+ }
+ case 8: {
+ message = createStartSessionMessage(intValue, intValue + 1);
+ break;
+ }
+ }
+
isValidVmsMessage(*message);
- message = createUnsubscribeMessage(layer);
-
- VmsOffers offers = {intValue, {VmsLayerOffering(VmsLayer(1, 0, 2))}};
- message = createOfferingMessage(offers);
- std::vector<VmsLayer> dependencies = {VmsLayer(2, 0, 2), VmsLayer(3, 0, 3)};
- std::vector<VmsLayerOffering> offering = {VmsLayerOffering(layer, dependencies)};
- offers = {intValue, offering};
- message = createOfferingMessage(offers);
-
- message = createAvailabilityRequest();
- message = createSubscriptionsRequest();
-
- std::string bytes = "placeholder";
- const VmsLayerAndPublisher layer_and_publisher(VmsLayer(2, 0, 1), intValue);
- message = createDataMessageWithLayerPublisherInfo(layer_and_publisher, bytes);
- parseData(*message);
- createSubscribeToPublisherMessage(layer_and_publisher);
- createUnsubscribeToPublisherMessage(layer_and_publisher);
-
- std::string pub_bytes = "pub_id";
- message = createPublisherIdRequest(pub_bytes);
- message = createBaseVmsMessage(2);
message->value.int32Values =
- hidl_vec<int32_t>{toInt(VmsMessageType::PUBLISHER_ID_RESPONSE), intValue};
- parsePublisherIdResponse(*message);
+ hidl_vec<int32_t>{mFuzzedDataProvider->ConsumeIntegral<int32_t>(), intValue};
- message->value.int32Values =
- hidl_vec<int32_t>{toInt(kSubscriptionMessageType[subscriptionMsgType]), intValue};
- getSequenceNumberForSubscriptionsState(*message);
-
- message->value.int32Values = hidl_vec<int32_t>{toInt(kSubscriptionMessageType[0]), intValue};
- isSequenceNumberNewer(*message, intValue + 1);
- invokeGetSubscribedLayers(kSubscriptionMessageType[subscriptionMsgType]);
-
- message->value.int32Values =
- hidl_vec<int32_t>{toInt(kAvailabilityMessageType[availabilityMsgType]), 0};
- hasServiceNewlyStarted(*message);
- message = createStartSessionMessage(intValue, intValue + 1);
- parseMessageType(*message);
-
- message->value.int32Values =
- hidl_vec<int32_t>{toInt(kAvailabilityMessageType[availabilityMsgType]), intValue};
- isAvailabilitySequenceNumberNewer(*message, intValue + 1);
-
- message->value.int32Values =
- hidl_vec<int32_t>{toInt(kAvailabilityMessageType[availabilityMsgType]), intValue};
- getSequenceNumberForAvailabilityState(*message);
- message = createBaseVmsMessage(3);
- int new_service_id;
- message->value.int32Values = hidl_vec<int32_t>{toInt(VmsMessageType::START_SESSION), 0, -1};
- parseStartSessionMessage(*message, -1, 0, &new_service_id);
+ auto invokeVmsUtilsAPI = mFuzzedDataProvider->PickValueInArray<const std::function<void()>>({
+ [&]() { parseData(*message); },
+ [&]() { createSubscribeToPublisherMessage(layer_and_publisher); },
+ [&]() { createUnsubscribeToPublisherMessage(layer_and_publisher); },
+ [&]() { parsePublisherIdResponse(*message); },
+ [&]() { getSequenceNumberForSubscriptionsState(*message); },
+ [&]() { isSequenceNumberNewer(*message, intValue + 1); },
+ [&]() {
+ invokeGetSubscribedLayers(
+ (VmsMessageType)mFuzzedDataProvider->ConsumeIntegral<int32_t>());
+ },
+ [&]() { hasServiceNewlyStarted(*message); },
+ [&]() { parseMessageType(*message); },
+ [&]() { isAvailabilitySequenceNumberNewer(*message, intValue + 1); },
+ [&]() { getSequenceNumberForAvailabilityState(*message); },
+ [&]() {
+ int32_t new_service_id;
+ parseStartSessionMessage(*message, -1, 0, &new_service_id);
+ },
+ });
+ invokeVmsUtilsAPI();
}
void VehicleHalManagerFuzzer::invokeGet(int32_t property, int32_t areaId) {
@@ -367,27 +468,31 @@
mActualStatusCode = refStatus;
}
-void VehicleHalManagerFuzzer::invokeGetSubscribedLayers(VmsMessageType type) {
- VmsOffers offers = {123,
- {VmsLayerOffering(VmsLayer(1, 0, 1), {VmsLayer(4, 1, 1)}),
- VmsLayerOffering(VmsLayer(2, 0, 1))}};
- auto message = createBaseVmsMessage(16);
- message->value.int32Values = hidl_vec<int32_t>{toInt(type),
- 1234, // sequence number
- 2, // number of layers
- 1, // number of associated layers
- 1, // layer 1
- 0, 1,
- 4, // layer 2
- 1, 1,
- 2, // associated layer
- 0, 1,
- 2, // number of publisher IDs
- 111, // publisher IDs
- 123};
- isValidVmsMessage(*message);
- getSubscribedLayers(*message, offers);
- getAvailableLayers(*message);
+void VehicleHalManagerFuzzer::invokeGetSubscribedLayers(VmsMessageType /*type*/) {
+ int32_t intValue = mFuzzedDataProvider->ConsumeIntegral<int32_t>();
+ VmsOffers offers = {
+ intValue,
+ {VmsLayerOffering(VmsLayer(mFuzzedDataProvider->ConsumeIntegral<int32_t>(),
+ mFuzzedDataProvider->ConsumeIntegral<int32_t>(),
+ mFuzzedDataProvider->ConsumeIntegral<int32_t>()))}};
+ auto message = createBaseVmsMessage(
+ mFuzzedDataProvider->ConsumeIntegralInRange<size_t>(kMinSize, kMaxFileSize));
+ std::vector<int32_t> v;
+ size_t size = mFuzzedDataProvider->ConsumeIntegralInRange<size_t>(kMinSize, kMaxSize);
+ for (size_t i = 0; i < size; i++) {
+ v.push_back(mFuzzedDataProvider->ConsumeIntegralInRange<int32_t>(kMinSize, kMaxSize));
+ }
+
+ message->value.int32Values = hidl_vec<int32_t>(v);
+ if (!isValidVmsMessage(*message)) {
+ return;
+ }
+
+ if (mFuzzedDataProvider->ConsumeBool()) {
+ getSubscribedLayers(*message, offers);
+ } else {
+ getAvailableLayers(*message);
+ }
}
void VehicleHalManagerFuzzer::invokeVehiclePropStore() {
@@ -398,33 +503,49 @@
.prop = vehicleProp,
.access = VehiclePropertyAccess::READ,
.changeMode = VehiclePropertyChangeMode::STATIC,
- .areaConfigs = {VehicleAreaConfig{.areaId = (0)}},
+ .areaConfigs = {VehicleAreaConfig{
+ .areaId = (mFuzzedDataProvider->ConsumeIntegral<int32_t>())}},
};
- store->registerProperty(config);
VehiclePropValue propValue{};
propValue.prop = vehicleProp;
- propValue.areaId = 0;
- store->writeValue(propValue, shouldWriteStatus);
- store->readAllValues();
- store->getAllConfigs();
- store->getConfigOrNull(vehicleProp);
- store->readValuesForProperty(vehicleProp);
- store->readValueOrNull(propValue);
- store->readValueOrNull(propValue.prop, propValue.areaId, 0);
- store->removeValuesForProperty(vehicleProp);
- store->removeValue(propValue);
- store->getConfigOrDie(vehicleProp);
+ propValue.areaId = mFuzzedDataProvider->ConsumeIntegral<int32_t>();
+
+ auto invokeVehiclePropStoreAPI =
+ mFuzzedDataProvider->PickValueInArray<const std::function<void()>>({
+ [&]() { store->registerProperty(config); },
+ [&]() { store->writeValue(propValue, shouldWriteStatus); },
+ [&]() { store->readAllValues(); },
+ [&]() { store->getAllConfigs(); },
+ [&]() { store->getConfigOrNull(vehicleProp); },
+ [&]() { store->readValuesForProperty(vehicleProp); },
+ [&]() { store->readValueOrNull(propValue); },
+ [&]() {
+ store->readValueOrNull(propValue.prop, propValue.areaId,
+ mFuzzedDataProvider->ConsumeIntegralInRange<int64_t>(
+ kMinSize, kMaxFileSize));
+ },
+ [&]() { store->removeValuesForProperty(vehicleProp); },
+ [&]() { store->removeValue(propValue); },
+ [&]() {
+ if (store->getConfigOrNull(vehicleProp)) {
+ store->getConfigOrDie(vehicleProp);
+ }
+ },
+ });
+ invokeVehiclePropStoreAPI();
}
void VehicleHalManagerFuzzer::invokeWatchDogClient() {
- auto service = new VehicleHalManager(mHal.get());
sp<Looper> looper(Looper::prepare(/*opts=*/mFuzzedDataProvider->ConsumeBool()));
- if (auto watchdogClient = ndk::SharedRefBase::make<WatchdogClient>(looper, service);
+ if (auto watchdogClient = ndk::SharedRefBase::make<WatchdogClient>(looper, mManager.get());
watchdogClient->initialize()) {
- watchdogClient->checkIfAlive(-1, TimeoutLength::TIMEOUT_NORMAL);
+ if (mFuzzedDataProvider->ConsumeBool()) {
+ watchdogClient->checkIfAlive(
+ mFuzzedDataProvider->ConsumeIntegral<int32_t>(),
+ (TimeoutLength)mFuzzedDataProvider->ConsumeIntegral<int32_t>());
+ }
watchdogClient->prepareProcessTermination();
}
- delete service;
}
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
diff --git a/automotive/vehicle/2.0/default/tests/fuzzer/VehicleManager_fuzzer.h b/automotive/vehicle/2.0/default/tests/fuzzer/VehicleManager_fuzzer.h
index e9335d3..26ac11e 100644
--- a/automotive/vehicle/2.0/default/tests/fuzzer/VehicleManager_fuzzer.h
+++ b/automotive/vehicle/2.0/default/tests/fuzzer/VehicleManager_fuzzer.h
@@ -98,6 +98,13 @@
}
void process(const uint8_t* data, size_t size);
+ template <typename T>
+ void fillParameter(size_t size, std::vector<T>& data) {
+ for (size_t i = 0; i < size; ++i) {
+ data.push_back(mFuzzedDataProvider->ConsumeIntegral<T>());
+ }
+ }
+
private:
FuzzedDataProvider* mFuzzedDataProvider = nullptr;
VehiclePropValue mActualValue = VehiclePropValue{};
@@ -108,6 +115,7 @@
std::unique_ptr<VehicleHalManager> mManager;
void invokeDebug();
+ void initValue();
void invokePropConfigs();
void invokeSubscribe();
void invokeSetAndGetValues();
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl
index 08863b2..aab3c46 100644
--- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl
+++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl
@@ -77,7 +77,7 @@
* This applies for continuous property only.
*
* It is HIGHLY RECOMMENDED to support variable update rate for all non-heartbeat continuous
- * properties for better performance.
+ * properties for better performance unless the property is large.
*
* If variable update rate is supported and 'enableVariableUpdateRate' is true in subscribe
* options, VHAL must only sends property update event when the property's value changes
@@ -95,6 +95,9 @@
* property event, and must use getValues to fetch the initial value. In fact, car service is
* using getValues to fetch the initial value, convert it to a property event and deliver to
* car service clients.
+ *
+ * NOTE: If this is true, car service may cache the property update event for filtering purpose,
+ * so this should be false if the property is large (e.g. a byte array of 1k in size).
*/
boolean supportVariableUpdateRate;
}
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 7ff03c6..cc4fae1 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp
+++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp
@@ -1055,10 +1055,11 @@
}
auto updatedValue = mValuePool->obtain(value);
- int64_t timestamp = elapsedRealtimeNano();
- updatedValue->timestamp = timestamp;
- auto writeResult = mServerSidePropStore->writeValue(std::move(updatedValue));
+ auto writeResult = mServerSidePropStore->writeValue(
+ std::move(updatedValue),
+ /*updateStatus=*/false, /*mode=*/VehiclePropertyStore::EventMode::ON_VALUE_CHANGE,
+ /*useCurrentTimestamp=*/true);
if (!writeResult.ok()) {
return StatusError(getErrorCode(writeResult))
<< StringPrintf("failed to write value into property store, error: %s",
@@ -2091,10 +2092,10 @@
// Failed to read current value, skip refreshing.
return;
}
- result.value()->timestamp = elapsedRealtimeNano();
- mServerSidePropStore->writeValue(std::move(result.value()), /*updateStatus=*/true,
- eventMode);
+ mServerSidePropStore->writeValue(std::move(result.value()),
+ /*updateStatus=*/true, eventMode,
+ /*useCurrentTimestamp=*/true);
});
mRecurrentTimer->registerTimerCallback(intervalInNanos, action);
mRecurrentActions[propIdAreaId] = action;
diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h b/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h
index b74dff5..2812c3b 100644
--- a/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h
+++ b/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h
@@ -100,9 +100,11 @@
// override an existing value, the status for the existing value would be used for the
// overridden value.
// 'EventMode' controls whether the 'OnValueChangeCallback' will be called for this operation.
+ // If 'useCurrentTimestamp' is true, the property value will be set to the current timestamp.
VhalResult<void> writeValue(VehiclePropValuePool::RecyclableType propValue,
bool updateStatus = false,
- EventMode mode = EventMode::ON_VALUE_CHANGE) EXCLUDES(mLock);
+ EventMode mode = EventMode::ON_VALUE_CHANGE,
+ bool useCurrentTimestamp = false) EXCLUDES(mLock);
// Remove a given property value from the property store. The 'propValue' would be used to
// generate the key for the value to remove.
diff --git a/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp b/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp
index 3fd2aa8..b879850 100644
--- a/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp
+++ b/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp
@@ -16,6 +16,7 @@
#define LOG_TAG "VehiclePropertyStore"
#include <utils/Log.h>
+#include <utils/SystemClock.h>
#include "VehiclePropertyStore.h"
@@ -107,13 +108,20 @@
VhalResult<void> VehiclePropertyStore::writeValue(VehiclePropValuePool::RecyclableType propValue,
bool updateStatus,
- VehiclePropertyStore::EventMode eventMode) {
+ VehiclePropertyStore::EventMode eventMode,
+ bool useCurrentTimestamp) {
bool valueUpdated = true;
VehiclePropValue updatedValue;
OnValueChangeCallback onValueChangeCallback = nullptr;
{
std::scoped_lock<std::mutex> g(mLock);
+ // Must set timestamp inside the lock to make sure no other writeValue will update the
+ // the timestamp to a newer one while we are writing this value.
+ if (useCurrentTimestamp) {
+ propValue->timestamp = elapsedRealtimeNano();
+ }
+
int32_t propId = propValue->prop;
VehiclePropertyStore::Record* record = getRecordLocked(propId);
diff --git a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h
index 9a42180..f7a71b4 100644
--- a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h
+++ b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h
@@ -191,6 +191,10 @@
const std::vector<aidl::android::hardware::automotive::vehicle::SubscribeOptions>&
options);
+ VhalResult<void> checkPermissionHelper(
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value,
+ aidl::android::hardware::automotive::vehicle::VehiclePropertyAccess accessToTest) const;
+
VhalResult<void> checkReadPermission(
const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const;
diff --git a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp
index d85cc09..847f3b8 100644
--- a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp
+++ b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp
@@ -605,6 +605,23 @@
return vectorToStableLargeParcelable(std::move(configs), output);
}
+bool hasRequiredAccess(VehiclePropertyAccess access, VehiclePropertyAccess requiredAccess) {
+ return access == requiredAccess || access == VehiclePropertyAccess::READ_WRITE;
+}
+
+bool areaConfigsHaveRequiredAccess(const std::vector<VehicleAreaConfig>& areaConfigs,
+ VehiclePropertyAccess requiredAccess) {
+ if (areaConfigs.empty()) {
+ return false;
+ }
+ for (VehicleAreaConfig areaConfig : areaConfigs) {
+ if (!hasRequiredAccess(areaConfig.access, requiredAccess)) {
+ return false;
+ }
+ }
+ return true;
+}
+
VhalResult<void> DefaultVehicleHal::checkSubscribeOptions(
const std::vector<SubscribeOptions>& options) {
for (const auto& option : options) {
@@ -614,6 +631,26 @@
<< StringPrintf("no config for property, ID: %" PRId32, propId);
}
const VehiclePropConfig& config = mConfigsByPropId[propId];
+ std::vector<VehicleAreaConfig> areaConfigs;
+ if (option.areaIds.empty()) {
+ areaConfigs = config.areaConfigs;
+ } else {
+ std::unordered_map<int, VehicleAreaConfig> areaConfigByAreaId;
+ for (const VehicleAreaConfig& areaConfig : config.areaConfigs) {
+ areaConfigByAreaId.emplace(areaConfig.areaId, areaConfig);
+ }
+ for (int areaId : option.areaIds) {
+ auto it = areaConfigByAreaId.find(areaId);
+ if (it != areaConfigByAreaId.end()) {
+ areaConfigs.push_back(it->second);
+ } else if (areaId != 0 || !areaConfigByAreaId.empty()) {
+ return StatusError(StatusCode::INVALID_ARG)
+ << StringPrintf("invalid area ID: %" PRId32 " for prop ID: %" PRId32
+ ", not listed in config",
+ areaId, propId);
+ }
+ }
+ }
if (config.changeMode != VehiclePropertyChangeMode::ON_CHANGE &&
config.changeMode != VehiclePropertyChangeMode::CONTINUOUS) {
@@ -621,8 +658,9 @@
<< "only support subscribing to ON_CHANGE or CONTINUOUS property";
}
- if (config.access != VehiclePropertyAccess::READ &&
- config.access != VehiclePropertyAccess::READ_WRITE) {
+ // Either VehiclePropConfig.access or VehicleAreaConfig.access will be specified
+ if (!hasRequiredAccess(config.access, VehiclePropertyAccess::READ) &&
+ !areaConfigsHaveRequiredAccess(areaConfigs, VehiclePropertyAccess::READ)) {
return StatusError(StatusCode::ACCESS_DENIED)
<< StringPrintf("Property %" PRId32 " has no read access", propId);
}
@@ -644,20 +682,6 @@
<< "invalid sample rate: " << sampleRateHz << " HZ";
}
}
-
- if (isGlobalProp(propId)) {
- continue;
- }
-
- // Non-global property.
- for (int32_t areaId : option.areaIds) {
- if (auto areaConfig = getAreaConfig(propId, areaId, config); areaConfig == nullptr) {
- return StatusError(StatusCode::INVALID_ARG)
- << StringPrintf("invalid area ID: %" PRId32 " for prop ID: %" PRId32
- ", not listed in config",
- areaId, propId);
- }
- }
}
return {};
}
@@ -776,36 +800,42 @@
return mVehicleHardware.get();
}
-VhalResult<void> DefaultVehicleHal::checkWritePermission(const VehiclePropValue& value) const {
+VhalResult<void> DefaultVehicleHal::checkPermissionHelper(
+ const VehiclePropValue& value, VehiclePropertyAccess accessToTest) const {
+ static const std::unordered_set<VehiclePropertyAccess> validAccesses = {
+ VehiclePropertyAccess::WRITE, VehiclePropertyAccess::READ,
+ VehiclePropertyAccess::READ_WRITE};
+ if (validAccesses.find(accessToTest) == validAccesses.end()) {
+ return StatusError(StatusCode::INVALID_ARG)
+ << "checkPermissionHelper parameter is an invalid access type";
+ }
+
int32_t propId = value.prop;
auto result = getConfig(propId);
if (!result.ok()) {
return StatusError(StatusCode::INVALID_ARG) << getErrorMsg(result);
}
const VehiclePropConfig* config = result.value();
+ const VehicleAreaConfig* areaConfig = getAreaConfig(value, *config);
- if (config->access != VehiclePropertyAccess::WRITE &&
- config->access != VehiclePropertyAccess::READ_WRITE) {
+ if (areaConfig == nullptr && !isGlobalProp(propId)) {
+ return StatusError(StatusCode::INVALID_ARG) << "no config for area ID: " << value.areaId;
+ }
+ if (!hasRequiredAccess(config->access, accessToTest) &&
+ (areaConfig == nullptr || !hasRequiredAccess(areaConfig->access, accessToTest))) {
return StatusError(StatusCode::ACCESS_DENIED)
- << StringPrintf("Property %" PRId32 " has no write access", propId);
+ << StringPrintf("Property %" PRId32 " does not have the following access: %" PRId32,
+ propId, accessToTest);
}
return {};
}
-VhalResult<void> DefaultVehicleHal::checkReadPermission(const VehiclePropValue& value) const {
- int32_t propId = value.prop;
- auto result = getConfig(propId);
- if (!result.ok()) {
- return StatusError(StatusCode::INVALID_ARG) << getErrorMsg(result);
- }
- const VehiclePropConfig* config = result.value();
+VhalResult<void> DefaultVehicleHal::checkWritePermission(const VehiclePropValue& value) const {
+ return checkPermissionHelper(value, VehiclePropertyAccess::WRITE);
+}
- if (config->access != VehiclePropertyAccess::READ &&
- config->access != VehiclePropertyAccess::READ_WRITE) {
- return StatusError(StatusCode::ACCESS_DENIED)
- << StringPrintf("Property %" PRId32 " has no read access", propId);
- }
- return {};
+VhalResult<void> DefaultVehicleHal::checkReadPermission(const VehiclePropValue& value) const {
+ return checkPermissionHelper(value, VehiclePropertyAccess::READ);
}
void DefaultVehicleHal::checkHealth(IVehicleHardware* vehicleHardware,
diff --git a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp
index 7195d97..63964ef 100644
--- a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp
+++ b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp
@@ -100,6 +100,10 @@
constexpr int32_t WRITE_ONLY_PROP = 10007 + 0x10000000 + 0x01000000 + 0x00400000;
// VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
constexpr int32_t GLOBAL_CONTINUOUS_PROP_NO_VUR = 10008 + 0x10000000 + 0x01000000 + 0x00400000;
+// VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
+constexpr int32_t GLOBAL_NONE_ACCESS_PROP = 10009 + 0x10000000 + 0x01000000 + 0x00400000;
+// VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:INT32
+constexpr int32_t AREA_NONE_ACCESS_PROP = 10010 + 0x10000000 + 0x03000000 + 0x00400000;
int32_t testInt32VecProp(size_t i) {
// VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC
@@ -175,6 +179,26 @@
.value.int32Values = {0},
},
.expectedStatus = StatusCode::ACCESS_DENIED,
+ },
+ {
+ .name = "none_access",
+ .request =
+ {
+ .prop = GLOBAL_NONE_ACCESS_PROP,
+ .value.int32Values = {0},
+ },
+ .expectedStatus = StatusCode::ACCESS_DENIED,
+ },
+ {
+ .name = "none_area_access",
+ .request =
+ {
+ .prop = AREA_NONE_ACCESS_PROP,
+ .value.int32Values = {0},
+ // Only ROW_1_LEFT is allowed.
+ .areaId = toInt(VehicleAreaWindow::ROW_1_RIGHT),
+ },
+ .expectedStatus = StatusCode::ACCESS_DENIED,
}};
}
@@ -228,11 +252,11 @@
for (size_t i = 0; i < 10000; i++) {
testConfigs.push_back(VehiclePropConfig{
.prop = testInt32VecProp(i),
- .access = VehiclePropertyAccess::READ_WRITE,
.areaConfigs =
{
{
.areaId = 0,
+ .access = VehiclePropertyAccess::READ_WRITE,
.minInt32Value = 0,
.maxInt32Value = 100,
},
@@ -242,9 +266,9 @@
// A property with area config.
testConfigs.push_back(
VehiclePropConfig{.prop = INT32_WINDOW_PROP,
- .access = VehiclePropertyAccess::READ_WRITE,
.areaConfigs = {{
.areaId = toInt(VehicleAreaWindow::ROW_1_LEFT),
+ .access = VehiclePropertyAccess::READ_WRITE,
.minInt32Value = 0,
.maxInt32Value = 100,
}}});
@@ -275,18 +299,19 @@
// A per-area on-change property.
testConfigs.push_back(VehiclePropConfig{
.prop = AREA_ON_CHANGE_PROP,
- .access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.areaConfigs =
{
{
.areaId = toInt(VehicleAreaWindow::ROW_1_LEFT),
+ .access = VehiclePropertyAccess::READ_WRITE,
.minInt32Value = 0,
.maxInt32Value = 100,
},
{
.areaId = toInt(VehicleAreaWindow::ROW_1_RIGHT),
+ .access = VehiclePropertyAccess::READ,
.minInt32Value = 0,
.maxInt32Value = 100,
},
@@ -295,7 +320,6 @@
// A per-area continuous property.
testConfigs.push_back(VehiclePropConfig{
.prop = AREA_CONTINUOUS_PROP,
- .access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::CONTINUOUS,
.minSampleRate = 0.0,
.maxSampleRate = 1000.0,
@@ -304,12 +328,14 @@
{
.areaId = toInt(VehicleAreaWindow::ROW_1_LEFT),
+ .access = VehiclePropertyAccess::READ_WRITE,
.minInt32Value = 0,
.maxInt32Value = 100,
.supportVariableUpdateRate = true,
},
{
.areaId = toInt(VehicleAreaWindow::ROW_1_RIGHT),
+ .access = VehiclePropertyAccess::READ_WRITE,
.minInt32Value = 0,
.maxInt32Value = 100,
.supportVariableUpdateRate = false,
@@ -332,6 +358,37 @@
.minSampleRate = 0.0,
.maxSampleRate = 1000.0,
});
+ // Global access set to NONE
+ testConfigs.push_back(VehiclePropConfig{
+ .prop = GLOBAL_NONE_ACCESS_PROP,
+ .access = VehiclePropertyAccess::NONE,
+ .changeMode = VehiclePropertyChangeMode::CONTINUOUS,
+ .minSampleRate = 0.0,
+ .maxSampleRate = 100.0,
+ });
+ // Area access set to NONE
+ testConfigs.push_back(VehiclePropConfig{
+ .prop = AREA_NONE_ACCESS_PROP,
+ .changeMode = VehiclePropertyChangeMode::CONTINUOUS,
+ .minSampleRate = 0.0,
+ .maxSampleRate = 1000.0,
+ .areaConfigs =
+ {
+ {
+
+ .areaId = toInt(VehicleAreaWindow::ROW_1_LEFT),
+ .access = VehiclePropertyAccess::NONE,
+ .minInt32Value = 0,
+ .maxInt32Value = 100,
+ },
+ {
+ .areaId = toInt(VehicleAreaWindow::ROW_1_RIGHT),
+ .access = VehiclePropertyAccess::NONE,
+ .minInt32Value = 0,
+ .maxInt32Value = 100,
+ },
+ },
+ });
// Register the heartbeat event property.
testConfigs.push_back(VehiclePropConfig{
.prop = toInt(VehicleProperty::VHAL_HEARTBEAT),
@@ -673,6 +730,21 @@
.prop = WRITE_ONLY_PROP,
},
},
+ {
+ .requestId = 1,
+ .prop =
+ {
+ .prop = GLOBAL_NONE_ACCESS_PROP,
+ },
+ },
+ {
+ .requestId = 2,
+ .prop =
+ {
+ .prop = AREA_NONE_ACCESS_PROP,
+ .areaId = toInt(VehicleAreaWindow::ROW_1_LEFT),
+ },
+ },
},
};
@@ -690,6 +762,14 @@
.requestId = 0,
.status = StatusCode::ACCESS_DENIED,
},
+ {
+ .requestId = 1,
+ .status = StatusCode::ACCESS_DENIED,
+ },
+ {
+ .requestId = 2,
+ .status = StatusCode::ACCESS_DENIED,
+ },
}))
<< "expect to get ACCESS_DENIED status if no read permission";
}
@@ -1316,8 +1396,8 @@
auto maybeResults = getCallback()->nextOnPropertyEventResults();
ASSERT_TRUE(maybeResults.has_value()) << "no results in callback";
- ASSERT_THAT(maybeResults.value().payloads, UnorderedElementsAre(testValue1, testValue2))
- << "results mismatch, expect two on-change events for all updated areas";
+ ASSERT_THAT(maybeResults.value().payloads, UnorderedElementsAre(testValue1))
+ << "results mismatch, expect one on-change events for all updated areas";
ASSERT_FALSE(getCallback()->nextOnPropertyEventResults().has_value())
<< "more results than expected";
}
@@ -1627,6 +1707,27 @@
ASSERT_EQ(status.getServiceSpecificError(), toInt(StatusCode::ACCESS_DENIED));
}
+TEST_F(DefaultVehicleHalTest, testSubscribeGlobalNoneAccess) {
+ std::vector<SubscribeOptions> options = {{
+ .propId = GLOBAL_NONE_ACCESS_PROP,
+ }};
+
+ auto status = getClient()->subscribe(getCallbackClient(), options, 0);
+
+ ASSERT_FALSE(status.isOk()) << "subscribe to a property with NONE global access must fail";
+ ASSERT_EQ(status.getServiceSpecificError(), toInt(StatusCode::ACCESS_DENIED));
+}
+
+TEST_F(DefaultVehicleHalTest, testSubscribeAreaNoneAccess) {
+ std::vector<SubscribeOptions> options = {
+ {.propId = AREA_NONE_ACCESS_PROP, .areaIds = {toInt(VehicleAreaWindow::ROW_1_LEFT)}}};
+
+ auto status = getClient()->subscribe(getCallbackClient(), options, 0);
+
+ ASSERT_FALSE(status.isOk()) << "subscribe to a property with NONE area access must fail";
+ ASSERT_EQ(status.getServiceSpecificError(), toInt(StatusCode::ACCESS_DENIED));
+}
+
TEST_F(DefaultVehicleHalTest, testUnsubscribeFailure) {
auto status = getClient()->unsubscribe(getCallbackClient(),
std::vector<int32_t>({GLOBAL_ON_CHANGE_PROP}));
@@ -1881,7 +1982,7 @@
};
SetValueResult result3 = {
.requestId = 3,
- .status = StatusCode::OK,
+ .status = StatusCode::ACCESS_DENIED,
};
// Prepare the responses
for (int i = 0; i < 2; i++) {
@@ -1907,9 +2008,8 @@
auto maybeResults = getCallback()->nextOnPropertyEventResults();
ASSERT_TRUE(maybeResults.has_value()) << "no results in callback";
- ASSERT_THAT(maybeResults.value().payloads,
- UnorderedElementsAre(testValue1, testValue2, testValue3))
- << "results mismatch, expect 3 batched on change events";
+ ASSERT_THAT(maybeResults.value().payloads, UnorderedElementsAre(testValue1, testValue2))
+ << "results mismatch, expect 2 batched on change events";
ASSERT_FALSE(getCallback()->nextOnPropertyEventResults().has_value())
<< "more results than expected";
}
diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/FoldState.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/FoldState.aidl
new file mode 100644
index 0000000..06baf00
--- /dev/null
+++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/FoldState.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.biometrics.common;
+/* @hide */
+@Backing(type="int") @VintfStability
+enum FoldState {
+ UNKNOWN,
+ HALF_OPENED,
+ FULLY_OPENED,
+ FULLY_CLOSED,
+}
diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationContext.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationContext.aidl
index 378017e..42c305a 100644
--- a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationContext.aidl
+++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationContext.aidl
@@ -45,4 +45,5 @@
android.hardware.biometrics.common.WakeReason wakeReason = android.hardware.biometrics.common.WakeReason.UNKNOWN;
android.hardware.biometrics.common.DisplayState displayState = android.hardware.biometrics.common.DisplayState.UNKNOWN;
@nullable android.hardware.biometrics.common.AuthenticateReason authenticateReason;
+ android.hardware.biometrics.common.FoldState foldState = android.hardware.biometrics.common.FoldState.UNKNOWN;
}
diff --git a/biometrics/common/aidl/android/hardware/biometrics/common/FoldState.aidl b/biometrics/common/aidl/android/hardware/biometrics/common/FoldState.aidl
new file mode 100644
index 0000000..03e606a
--- /dev/null
+++ b/biometrics/common/aidl/android/hardware/biometrics/common/FoldState.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.biometrics.common;
+
+/**
+ * Fold/Unfold state during an operation.
+ *
+ * @hide
+ */
+@VintfStability
+@Backing(type="int")
+enum FoldState {
+ /** The fold state is unknown. */
+ UNKNOWN,
+
+ /** The fold state is half opened. */
+ HALF_OPENED,
+
+ /** The fold state is fully opened. */
+ FULLY_OPENED,
+
+ /** The fold state is fully closed. */
+ FULLY_CLOSED,
+}
diff --git a/biometrics/common/aidl/android/hardware/biometrics/common/OperationContext.aidl b/biometrics/common/aidl/android/hardware/biometrics/common/OperationContext.aidl
index f4191d7..584057d 100644
--- a/biometrics/common/aidl/android/hardware/biometrics/common/OperationContext.aidl
+++ b/biometrics/common/aidl/android/hardware/biometrics/common/OperationContext.aidl
@@ -18,6 +18,7 @@
import android.hardware.biometrics.common.AuthenticateReason;
import android.hardware.biometrics.common.DisplayState;
+import android.hardware.biometrics.common.FoldState;
import android.hardware.biometrics.common.OperationReason;
import android.hardware.biometrics.common.WakeReason;
@@ -71,4 +72,7 @@
* framework may choose to omit the reason at any time based on the device's policy.
*/
@nullable AuthenticateReason authenticateReason;
+
+ /** The current fold/unfold state. */
+ FoldState foldState = FoldState.UNKNOWN;
}
diff --git a/bluetooth/aidl/default/BluetoothHci.cpp b/bluetooth/aidl/default/BluetoothHci.cpp
index 9862e9e..a247cb0 100644
--- a/bluetooth/aidl/default/BluetoothHci.cpp
+++ b/bluetooth/aidl/default/BluetoothHci.cpp
@@ -320,6 +320,7 @@
{
std::lock_guard<std::mutex> guard(mStateMutex);
mState = HalState::READY;
+ mH4 = nullptr;
}
return ndk::ScopedAStatus::ok();
}
@@ -346,13 +347,16 @@
ndk::ScopedAStatus BluetoothHci::send(PacketType type,
const std::vector<uint8_t>& v) {
- if (mH4 == nullptr) {
- return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
- }
if (v.empty()) {
ALOGE("Packet is empty, no data was found to be sent");
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
+
+ std::lock_guard<std::mutex> guard(mStateMutex);
+ if (mH4 == nullptr) {
+ return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
+ }
+
mH4->Send(type, v);
return ndk::ScopedAStatus::ok();
}
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
index 0bcafa3..c283148 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
+++ b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
@@ -439,6 +439,9 @@
}
void BluetoothAudioSession::ReportLowLatencyModeAllowedChanged(bool allowed) {
+ if (session_type_ != SessionType::A2DP_HARDWARE_OFFLOAD_ENCODING_DATAPATH) {
+ return;
+ }
std::lock_guard<std::recursive_mutex> guard(mutex_);
low_latency_allowed_ = allowed;
// TODO(b/294498919): Remove this after there is API to update latency mode
@@ -588,15 +591,32 @@
<< " has NO session";
return std::vector<LatencyMode>();
}
- if (low_latency_allowed_) return latency_modes_;
- std::vector<LatencyMode> modes;
- for (LatencyMode mode : latency_modes_) {
- if (mode == LatencyMode::LOW_LATENCY)
- // ignore those low latency mode if Bluetooth stack doesn't allow
- continue;
- modes.push_back(mode);
+
+ std::vector<LatencyMode> supported_latency_modes;
+ if (session_type_ ==
+ SessionType::LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH) {
+ for (LatencyMode mode : latency_modes_) {
+ if (mode == LatencyMode::LOW_LATENCY) {
+ // LOW_LATENCY is not supported for LE_HARDWARE_OFFLOAD_ENC sessions
+ continue;
+ }
+ supported_latency_modes.push_back(mode);
+ }
+ } else {
+ for (LatencyMode mode : latency_modes_) {
+ if (!low_latency_allowed_ && mode == LatencyMode::LOW_LATENCY) {
+ // ignore LOW_LATENCY mode if Bluetooth stack doesn't allow
+ continue;
+ }
+ if (mode == LatencyMode::DYNAMIC_SPATIAL_AUDIO_SOFTWARE ||
+ mode == LatencyMode::DYNAMIC_SPATIAL_AUDIO_HARDWARE) {
+ // DSA_SW and DSA_HW only supported for LE_HARDWARE_OFFLOAD_ENC sessions
+ continue;
+ }
+ supported_latency_modes.push_back(mode);
+ }
}
- return modes;
+ return supported_latency_modes;
}
void BluetoothAudioSession::SetLatencyMode(const LatencyMode& latency_mode) {
diff --git a/broadcastradio/aidl/default/BroadcastRadio.cpp b/broadcastradio/aidl/default/BroadcastRadio.cpp
index 54186b0..63073d7 100644
--- a/broadcastradio/aidl/default/BroadcastRadio.cpp
+++ b/broadcastradio/aidl/default/BroadcastRadio.cpp
@@ -329,7 +329,7 @@
std::optional<AmFmBandRange> range = getAmFmRangeLocked();
if (!range) {
LOG(ERROR) << __func__ << ": can't find current band or tune operation is in process";
- ScopedAStatus::fromServiceSpecificErrorWithMessage(
+ return ScopedAStatus::fromServiceSpecificErrorWithMessage(
resultToInt(Result::INTERNAL_ERROR),
"can't find current band or tune operation is in process");
}
diff --git a/camera/device/default/ExternalCameraDeviceSession.cpp b/camera/device/default/ExternalCameraDeviceSession.cpp
index 896e0da..a6ec4c7 100644
--- a/camera/device/default/ExternalCameraDeviceSession.cpp
+++ b/camera/device/default/ExternalCameraDeviceSession.cpp
@@ -789,9 +789,8 @@
outputBuffer.bufferId = buffer.bufferId;
outputBuffer.status = BufferStatus::ERROR;
if (buffer.acquireFence >= 0) {
- native_handle_t* handle = native_handle_create(/*numFds*/ 1, /*numInts*/ 0);
- handle->data[0] = buffer.acquireFence;
- outputBuffer.releaseFence = android::makeToAidl(handle);
+ outputBuffer.releaseFence.fds.resize(1);
+ outputBuffer.releaseFence.fds.at(0).set(buffer.acquireFence);
}
} else {
offlineBuffers.push_back(buffer);
@@ -1769,9 +1768,8 @@
result.outputBuffers[i].bufferId = req->buffers[i].bufferId;
result.outputBuffers[i].status = BufferStatus::ERROR;
if (req->buffers[i].acquireFence >= 0) {
- native_handle_t* handle = native_handle_create(/*numFds*/ 1, /*numInts*/ 0);
- handle->data[0] = req->buffers[i].acquireFence;
- result.outputBuffers[i].releaseFence = ::android::makeToAidl(handle);
+ result.outputBuffers[i].releaseFence.fds.resize(1);
+ result.outputBuffers[i].releaseFence.fds.at(0).set(req->buffers[i].acquireFence);
}
}
@@ -1815,18 +1813,16 @@
if (req->buffers[i].fenceTimeout) {
result.outputBuffers[i].status = BufferStatus::ERROR;
if (req->buffers[i].acquireFence >= 0) {
- native_handle_t* handle = native_handle_create(/*numFds*/ 1, /*numInts*/ 0);
- handle->data[0] = req->buffers[i].acquireFence;
- result.outputBuffers[i].releaseFence = ::android::makeToAidl(handle);
+ result.outputBuffers[i].releaseFence.fds.resize(1);
+ result.outputBuffers[i].releaseFence.fds.at(0).set(req->buffers[i].acquireFence);
}
notifyError(req->frameNumber, req->buffers[i].streamId, ErrorCode::ERROR_BUFFER);
} else {
result.outputBuffers[i].status = BufferStatus::OK;
// TODO: refactor
if (req->buffers[i].acquireFence >= 0) {
- native_handle_t* handle = native_handle_create(/*numFds*/ 1, /*numInts*/ 0);
- handle->data[0] = req->buffers[i].acquireFence;
- result.outputBuffers[i].releaseFence = ::android::makeToAidl(handle);
+ result.outputBuffers[i].releaseFence.fds.resize(1);
+ result.outputBuffers[i].releaseFence.fds.at(0).set(req->buffers[i].acquireFence);
}
}
}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl
index dd679f3..cfc9907 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl
@@ -1330,8 +1330,8 @@
/**
* android.sensor.frameDuration [dynamic, int64, public]
*
- * <p>Duration from start of frame exposure to
- * start of next frame exposure.</p>
+ * <p>Duration from start of frame readout to
+ * start of next frame readout.</p>
*/
ANDROID_SENSOR_FRAME_DURATION,
/**
diff --git a/camera/provider/aidl/vts/Android.bp b/camera/provider/aidl/vts/Android.bp
index 59f6c66..cfcaec5 100644
--- a/camera/provider/aidl/vts/Android.bp
+++ b/camera/provider/aidl/vts/Android.bp
@@ -53,6 +53,7 @@
"android.hardware.graphics.mapper@2.0",
"android.hardware.graphics.mapper@3.0",
"android.hardware.graphics.mapper@4.0",
+ "camera_platform_flags_c_lib",
],
// Statically link to libs not guaranteed to be present on the device.
@@ -67,6 +68,7 @@
"libhidlmemory",
"libgralloctypes",
"libaidlcommonsupport",
+ "libgtest",
],
require_root: true,
diff --git a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp
index b6b5206..def6233 100644
--- a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp
+++ b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+#include <gtest/gtest.h>
#include <aidl/Vintf.h>
#include <aidl/android/hardware/camera/common/VendorTagSection.h>
@@ -29,6 +30,7 @@
#include <hidl/GtestPrinter.h>
#include <hidl/HidlSupport.h>
#include <torch_provider_cb.h>
+#include <com_android_internal_camera_flags.h>
#include <list>
using ::aidl::android::hardware::camera::common::CameraDeviceStatus;
@@ -50,6 +52,7 @@
const uint32_t kMaxStillHeight = 1536;
const int64_t kEmptyFlushTimeoutMSec = 200;
+namespace flags = com::android::internal::camera::flags;
const static std::vector<int64_t> kMandatoryUseCases = {
ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT,
@@ -159,6 +162,28 @@
}
}
+// Validate the integrity of manual flash strength control metadata
+TEST_P(CameraAidlTest, validateManualFlashStrengthControlKeys) {
+ if (flags::camera_manual_flash_strength_control()) {
+ std::vector<std::string> cameraDeviceNames = getCameraDeviceNames(mProvider);
+ for (const auto& name : cameraDeviceNames) {
+ ALOGI("validateManualFlashStrengthControlKeys: Testing camera device %s", name.c_str());
+ CameraMetadata meta;
+ std::shared_ptr<ICameraDevice> cameraDevice;
+ openEmptyDeviceSession(name, mProvider, &mSession /*out*/, &meta /*out*/,
+ &cameraDevice /*out*/);
+ ndk::ScopedAStatus ret = cameraDevice->getCameraCharacteristics(&meta);
+ ASSERT_TRUE(ret.isOk());
+ const camera_metadata_t* staticMeta =
+ reinterpret_cast<const camera_metadata_t*>(meta.metadata.data());
+ verifyManualFlashStrengthControlCharacteristics(staticMeta);
+ }
+ } else {
+ ALOGI("validateManualFlashStrengthControlKeys: Test skipped.\n");
+ GTEST_SKIP();
+ }
+}
+
TEST_P(CameraAidlTest, systemCameraTest) {
std::vector<std::string> cameraDeviceNames = getCameraDeviceNames(mProvider);
std::map<std::string, std::vector<SystemCameraKind>> hiddenPhysicalIdToLogicalMap;
diff --git a/camera/provider/aidl/vts/camera_aidl_test.cpp b/camera/provider/aidl/vts/camera_aidl_test.cpp
index 6a17453..e5bf637 100644
--- a/camera/provider/aidl/vts/camera_aidl_test.cpp
+++ b/camera/provider/aidl/vts/camera_aidl_test.cpp
@@ -1152,6 +1152,58 @@
}
}
+void CameraAidlTest::verifyManualFlashStrengthControlCharacteristics(
+ const camera_metadata_t* staticMeta) {
+ camera_metadata_ro_entry singleMaxEntry;
+ camera_metadata_ro_entry singleDefEntry;
+ camera_metadata_ro_entry torchMaxEntry;
+ camera_metadata_ro_entry torchDefEntry;
+ bool torch_supported = false;
+ int32_t singleMaxLevel = 0;
+ int32_t singleDefLevel = 0;
+ int32_t torchMaxLevel = 0;
+ int32_t torchDefLevel = 0;
+
+ // determine whether the device supports torch or not
+ torch_supported = isTorchSupported(staticMeta);
+
+ int singleMaxRetCode = find_camera_metadata_ro_entry(staticMeta,
+ ANDROID_FLASH_SINGLE_STRENGTH_MAX_LEVEL, &singleMaxEntry);
+ int singleDefRetCode = find_camera_metadata_ro_entry(staticMeta,
+ ANDROID_FLASH_SINGLE_STRENGTH_DEFAULT_LEVEL, &singleDefEntry);
+ int torchMaxRetCode = find_camera_metadata_ro_entry(staticMeta,
+ ANDROID_FLASH_TORCH_STRENGTH_MAX_LEVEL, &torchMaxEntry);
+ int torchDefRetCode = find_camera_metadata_ro_entry(staticMeta,
+ ANDROID_FLASH_TORCH_STRENGTH_DEFAULT_LEVEL, &torchDefEntry);
+ if (torch_supported) {
+ if(singleMaxRetCode == 0 && singleDefRetCode == 0 && torchMaxRetCode == 0 &&
+ torchDefRetCode == 0) {
+ singleMaxLevel = *singleMaxEntry.data.i32;
+ singleDefLevel = *singleDefEntry.data.i32;
+ torchMaxLevel = *torchMaxEntry.data.i32;
+ torchDefLevel = *torchDefEntry.data.i32;
+ ASSERT_TRUE((singleMaxEntry.count == singleDefEntry.count == torchMaxEntry.count
+ == torchDefEntry.count == 1));
+ } else {
+ ASSERT_TRUE((singleMaxEntry.count == singleDefEntry.count == torchMaxEntry.count
+ == torchDefEntry.count == 0));
+ }
+ // if the device supports this feature default levels should be greater than 0
+ if (singleMaxLevel > 1) {
+ ASSERT_GT(torchMaxLevel, 1);
+ ASSERT_GT(torchDefLevel, 0);
+ ASSERT_GT(singleDefLevel, 0);
+ ASSERT_TRUE(torchDefLevel <= torchMaxLevel); // default levels should be <= max levels
+ ASSERT_TRUE(singleDefLevel <= singleMaxLevel);
+ }
+ } else {
+ ASSERT_TRUE(singleMaxRetCode != 0);
+ ASSERT_TRUE(singleDefRetCode != 0);
+ ASSERT_TRUE(torchMaxRetCode != 0);
+ ASSERT_TRUE(torchDefRetCode != 0);
+ }
+}
+
void CameraAidlTest::verifyRecommendedConfigs(const CameraMetadata& chars) {
size_t CONFIG_ENTRY_SIZE = 5;
size_t CONFIG_ENTRY_TYPE_OFFSET = 3;
diff --git a/camera/provider/aidl/vts/camera_aidl_test.h b/camera/provider/aidl/vts/camera_aidl_test.h
index 3018d5a..0ebd4ef 100644
--- a/camera/provider/aidl/vts/camera_aidl_test.h
+++ b/camera/provider/aidl/vts/camera_aidl_test.h
@@ -262,6 +262,9 @@
static void verifyMonochromeCharacteristics(const CameraMetadata& chars);
+ static void verifyManualFlashStrengthControlCharacteristics(
+ const camera_metadata_t* staticMeta);
+
static void verifyMonochromeCameraResult(
const ::android::hardware::camera::common::V1_0::helper::CameraMetadata& metadata);
diff --git a/compatibility_matrices/compatibility_matrix.9.xml b/compatibility_matrices/compatibility_matrix.9.xml
index 1ea8b62..2a8b772 100644
--- a/compatibility_matrices/compatibility_matrix.9.xml
+++ b/compatibility_matrices/compatibility_matrix.9.xml
@@ -85,6 +85,14 @@
</interface>
</hal>
<hal format="aidl" optional="true">
+ <name>android.hardware.macsec</name>
+ <version>1</version>
+ <interface>
+ <name>IMacsecPskPlugin</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
<name>android.hardware.automotive.occupant_awareness</name>
<version>1</version>
<interface>
@@ -648,7 +656,7 @@
</hal>
<hal format="aidl" optional="true" updatable-via-apex="true">
<name>android.hardware.wifi</name>
- <version>1</version>
+ <version>1-2</version>
<interface>
<name>IWifi</name>
<instance>default</instance>
@@ -672,7 +680,7 @@
</hal>
<hal format="aidl" optional="true">
<name>android.hardware.wifi.supplicant</name>
- <version>2</version>
+ <version>2-3</version>
<interface>
<name>ISupplicant</name>
<instance>default</instance>
diff --git a/keymaster/4.0/support/fuzzer/Android.bp b/keymaster/4.0/support/fuzzer/Android.bp
index 8bc681a..f61d10f 100644
--- a/keymaster/4.0/support/fuzzer/Android.bp
+++ b/keymaster/4.0/support/fuzzer/Android.bp
@@ -39,9 +39,17 @@
],
fuzz_config: {
cc: [
- "android-media-fuzzing-reports@google.com",
+ "android-hardware-security@google.com",
],
- componentid: 533764,
+ componentid: 1084733,
+ hotlists: [
+ "4593311",
+ ],
+ description: "The fuzzer targets the APIs of libkeymaster4support",
+ vector: "local_no_privileges_required",
+ service_privilege: "privileged",
+ users: "multi_user",
+ fuzzed_code_usage: "shipped",
},
}
diff --git a/macsec/OWNERS b/macsec/OWNERS
new file mode 100644
index 0000000..6934f86
--- /dev/null
+++ b/macsec/OWNERS
@@ -0,0 +1 @@
+keithmok@google.com
diff --git a/macsec/aidl/Android.bp b/macsec/aidl/Android.bp
new file mode 100644
index 0000000..5e47999
--- /dev/null
+++ b/macsec/aidl/Android.bp
@@ -0,0 +1,40 @@
+//
+// 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 {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "hardware_interfaces_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+aidl_interface {
+ name: "android.hardware.macsec",
+ vendor_available: true,
+ srcs: ["android/hardware/macsec/*.aidl"],
+ stability: "vintf",
+ host_supported: true,
+ backend: {
+ java: {
+ enabled: false,
+ },
+ rust: {
+ enabled: false,
+ },
+ },
+}
diff --git a/macsec/aidl/aidl_api/android.hardware.macsec/current/android/hardware/macsec/IMacsecPskPlugin.aidl b/macsec/aidl/aidl_api/android.hardware.macsec/current/android/hardware/macsec/IMacsecPskPlugin.aidl
new file mode 100644
index 0000000..6a93919
--- /dev/null
+++ b/macsec/aidl/aidl_api/android.hardware.macsec/current/android/hardware/macsec/IMacsecPskPlugin.aidl
@@ -0,0 +1,80 @@
+/*
+ * 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.macsec;
+
+/**
+ * MACSEC (IEEE 802.1AE) pre-shared key plugin for wpa_supplicant
+ *
+ * The goal of this service is to provide function for using the MACSEC CAK
+ *
+ */
+@VintfStability
+interface IMacsecPskPlugin {
+ /**
+ * For xTS test only inject a key to verify implementation correctness, not called in production
+ *
+ * @param keyId is key id to add
+ * @param Connectivity Association Keys (CAK) to set
+ * @param Connectivity Association Key Name (CKN) to set
+ *
+ */
+ void addTestKey(in byte[] keyId, in byte[] CAK, in byte[] CKN);
+
+ /**
+ * Use ICV key do AES CMAC
+ * same as ieee802_1x_icv_aes_cmac in wpa_supplicant
+ *
+ * @param keyId is key id to be used for AES CMAC
+ * @param data, a data pointer to the buffer for calculate the ICV
+ *
+ * @return Integrity check value (ICV).
+ */
+ byte[] calcIcv(in byte[] keyId, in byte[] data);
+
+ /**
+ * KDF with CAK key to generate Secure Association Key (SAK)
+ * same as ieee802_1x_sak_aes_cmac in wpa_supplicant
+ *
+ * @param keyId is key id to be used for KDF
+ * @param data is key seed (random number)
+ * @param sakLength generated SAK length (16 or 32)
+ *
+ * @return Secure Association Key (SAK).
+ */
+ byte[] generateSak(in byte[] keyId, in byte[] data, in int sakLength);
+
+ /**
+ * Encrypt using KEK key, this is same as aes_wrap with kek.key in wpa_supplicant
+ * which used to wrap a SAK key
+ *
+ * @param keyId is key id to be used for encryption
+ * @param sak is the SAK key (16 or 32 bytes) to be wrapped.
+ *
+ * @return wrapped data using Key Encrypting Key (KEK).
+ */
+ byte[] wrapSak(in byte[] keyId, in byte[] sak);
+
+ /**
+ * Decrypt using KEK key, this is same as aes_unwrap with kek.key in wpa_supplicant
+ * which used to unwrap a SAK key
+ *
+ * @param keyId is key id to be used for decryption
+ * @param sak is wrapped SAK key.
+ *
+ * @return unwrapped data using KEK key.
+ */
+ byte[] unwrapSak(in byte[] keyId, in byte[] sak);
+}
diff --git a/macsec/aidl/android/hardware/macsec/IMacsecPskPlugin.aidl b/macsec/aidl/android/hardware/macsec/IMacsecPskPlugin.aidl
new file mode 100644
index 0000000..a98cfa6
--- /dev/null
+++ b/macsec/aidl/android/hardware/macsec/IMacsecPskPlugin.aidl
@@ -0,0 +1,91 @@
+/*
+ * 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.macsec;
+
+/**
+ * MACSEC (IEEE 802.1AE) pre-shared key plugin for wpa_supplicant
+ *
+ * The goal of this service is to provide function for using the MACSEC CAK
+ *
+ */
+@VintfStability
+interface IMacsecPskPlugin {
+ /**
+ * For xTS test only inject a key to verify implementation correctness, not called in production
+ *
+ * @param keyId is key id to add
+ * @param Connectivity Association Keys (CAK) to set
+ * @param Connectivity Association Key Name (CKN) to set
+ * @throws EX_ILLEGAL_ARGUMENT If CAK size is not 16 or 32 or keyID size not equals to CAK size
+ */
+ void addTestKey(in byte[] keyId, in byte[] CAK, in byte[] CKN);
+
+ /**
+ * Use ICV key do AES CMAC
+ * same as ieee802_1x_icv_aes_cmac in wpa_supplicant
+ *
+ * @param keyId is key id to be used for AES CMAC
+ * @param data, a data pointer to the buffer for calculate the ICV
+ *
+ * @return Integrity check value (ICV).
+ * @throws EX_ILLEGAL_ARGUMENT If keyId does not exist
+ */
+ byte[] calcIcv(in byte[] keyId, in byte[] data);
+
+ /**
+ * KDF with CAK key to generate Secure Association Key (SAK)
+ * same as ieee802_1x_sak_aes_cmac in wpa_supplicant
+ *
+ * @param keyId is key id to be used for KDF
+ * @param data is key seed (random number)
+ * @param sakLength generated SAK length (16 or 32)
+ *
+ * @return Secure Association Key (SAK).
+ * @throws EX_ILLEGAL_ARGUMENT In the following cases:
+ * - If keyId does not exist
+ * - sakLength != 16 or 32
+ * - data length < sakLength
+ */
+ byte[] generateSak(in byte[] keyId, in byte[] data, in int sakLength);
+
+ /**
+ * Encrypt using KEK key, this is same as aes_wrap with kek.key in wpa_supplicant
+ * which used to wrap a SAK key
+ *
+ * @param keyId is key id to be used for encryption
+ * @param sak is the SAK key (16 or 32 bytes) to be wrapped.
+ *
+ * @return wrapped data using Key Encrypting Key (KEK).
+ * @throws EX_ILLEGAL_ARGUMENT In the following cases:
+ * - If keyId does not exist
+ * - sak size eqauls to 0 or not multiples of 8
+ */
+ byte[] wrapSak(in byte[] keyId, in byte[] sak);
+
+ /**
+ * Decrypt using KEK key, this is same as aes_unwrap with kek.key in wpa_supplicant
+ * which used to unwrap a SAK key
+ *
+ * @param keyId is key id to be used for decryption
+ * @param sak is wrapped SAK key.
+ *
+ * @return unwrapped data using KEK key.
+ * @throws EX_ILLEGAL_ARGUMENT In the following cases:
+ * - If keyId does not exist
+ * - sak size <= 8 or not multiples of 8
+ */
+ byte[] unwrapSak(in byte[] keyId, in byte[] sak);
+}
diff --git a/macsec/aidl/default/Android.bp b/macsec/aidl/default/Android.bp
new file mode 100644
index 0000000..7c7346f
--- /dev/null
+++ b/macsec/aidl/default/Android.bp
@@ -0,0 +1,64 @@
+//
+// 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 {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "hardware_interfaces_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+cc_binary {
+ name: "android.hardware.macsec-service",
+ init_rc: ["android.hardware.macsec.rc"],
+ vendor: true,
+ relative_install_path: "hw",
+ srcs: [
+ "MacsecPskPlugin.cpp",
+ "service.cpp",
+ ],
+ shared_libs: [
+ "android.hardware.macsec-V1-ndk",
+ "libcrypto",
+ "libbase",
+ "libbinder_ndk",
+ ],
+ vintf_fragments: ["android.hardware.macsec.xml"],
+}
+
+cc_fuzz {
+ name: "android.hardware.macsec@V1-default-service.aidl_fuzzer",
+ vendor: true,
+ srcs: [
+ "MacsecPskPlugin.cpp",
+ "fuzzer/fuzzer.cpp",
+ ],
+ shared_libs: [
+ "android.hardware.macsec-V1-ndk",
+ "libcrypto",
+ "liblog",
+ ],
+ defaults: [
+ "service_fuzzer_defaults",
+ ],
+ fuzz_config: {
+ cc: [
+ "keithmok@google.com",
+ ],
+ },
+}
diff --git a/macsec/aidl/default/MacsecPskPlugin.cpp b/macsec/aidl/default/MacsecPskPlugin.cpp
new file mode 100644
index 0000000..82d2545
--- /dev/null
+++ b/macsec/aidl/default/MacsecPskPlugin.cpp
@@ -0,0 +1,308 @@
+/*
+ * Copyright 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 "MacsecPskPlugin.h"
+#include <openssl/cipher.h>
+#include <openssl/mem.h>
+
+#include <android-base/format.h>
+#include <android-base/logging.h>
+
+namespace aidl::android::hardware::macsec {
+
+constexpr auto ok = &ndk::ScopedAStatus::ok;
+
+// vendor should hide the key in TEE/TA
+// CAK key can be either 16 / 32 bytes
+const std::vector<uint8_t> CAK_ID_1 = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01};
+const std::vector<uint8_t> CAK_KEY_1 = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
+ 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF};
+std::vector<uint8_t> CKN_1 = {0x31, 0x32, 0x33, 0x34}; // maximum 16 bytes
+
+const std::vector<uint8_t> CAK_ID_2 = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02};
+const std::vector<uint8_t> CAK_KEY_2 = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
+ 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
+ 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
+ 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF};
+std::vector<uint8_t> CKN_2 = {0x35, 0x36, 0x37, 0x38}; // maximum 16 bytes
+
+static ndk::ScopedAStatus resultToStatus(binder_exception_t res, const std::string& msg = "") {
+ if (msg.empty()) {
+ return ndk::ScopedAStatus::fromExceptionCode(res);
+ }
+ return ndk::ScopedAStatus::fromExceptionCodeWithMessage(res, msg.c_str());
+}
+
+static int omac1_aes(CMAC_CTX* ctx, const uint8_t* data, size_t data_len,
+ uint8_t* mac /* 16 bytes */) {
+ size_t outlen;
+
+ // Just reuse same key in ctx
+ if (!CMAC_Reset(ctx)) {
+ return -1;
+ }
+
+ if (!CMAC_Update(ctx, data, data_len)) {
+ return -1;
+ }
+
+ if (!CMAC_Final(ctx, mac, &outlen) || outlen != 16) {
+ return -1;
+ }
+ return 0;
+}
+
+static void put_be16(uint8_t* addr, uint16_t value) {
+ *addr++ = value >> 8;
+ *addr = value & 0xff;
+}
+
+/* IEEE Std 802.1X-2010, 6.2.1 KDF */
+static int aes_kdf(CMAC_CTX* ctx, const char* label, const uint8_t* context, int ctx_bits,
+ int ret_bits, uint8_t* ret) {
+ const int h = 128;
+ const int r = 8;
+ int i, n;
+ int lab_len, ctx_len, ret_len, buf_len;
+ uint8_t* buf;
+
+ lab_len = strlen(label);
+ ctx_len = (ctx_bits + 7) / 8;
+ ret_len = ((ret_bits & 0xffff) + 7) / 8;
+ buf_len = lab_len + ctx_len + 4;
+
+ memset(ret, 0, ret_len);
+
+ n = (ret_bits + h - 1) / h;
+ if (n > ((0x1 << r) - 1)) return -1;
+
+ buf = (uint8_t*)calloc(1, buf_len);
+ if (buf == NULL) return -1;
+
+ memcpy(buf + 1, label, lab_len);
+ memcpy(buf + lab_len + 2, context, ctx_len);
+ put_be16(&buf[buf_len - 2], ret_bits);
+
+ for (i = 0; i < n; i++) {
+ int res;
+
+ buf[0] = (uint8_t)(i + 1);
+ res = omac1_aes(ctx, buf, buf_len, ret);
+ if (res) {
+ free(buf);
+ return -1;
+ }
+ ret = ret + h / 8;
+ }
+ free(buf);
+ return 0;
+}
+
+MacsecPskPlugin::MacsecPskPlugin() {
+ // always make sure ckn is 16 bytes, zero padded
+ CKN_1.resize(16);
+ CKN_2.resize(16);
+
+ addTestKey(CAK_ID_1, CAK_KEY_1, CKN_1);
+ addTestKey(CAK_ID_2, CAK_KEY_2, CKN_2);
+}
+
+MacsecPskPlugin::~MacsecPskPlugin() {
+ for (auto s : mKeys) {
+ OPENSSL_cleanse(&s.kekEncCtx, sizeof(AES_KEY));
+ OPENSSL_cleanse(&s.kekDecCtx, sizeof(AES_KEY));
+ CMAC_CTX_free(s.ickCtx);
+ CMAC_CTX_free(s.cakCtx);
+ }
+}
+
+ndk::ScopedAStatus MacsecPskPlugin::addTestKey(const std::vector<uint8_t>& keyId,
+ const std::vector<uint8_t>& CAK,
+ const std::vector<uint8_t>& CKN) {
+ if (CAK.size() != 16 && CAK.size() != 32) {
+ return resultToStatus(EX_ILLEGAL_ARGUMENT, "CAK length must be 16 or 32 bytes");
+ }
+
+ if (keyId.size() != CAK.size()) {
+ return resultToStatus(EX_ILLEGAL_ARGUMENT, "Key ID must be same as CAK length");
+ }
+
+ std::vector<uint8_t> ckn;
+ ckn = CKN;
+ ckn.resize(16); // make sure it is always zero padded with maximum length of
+ // 16 bytes
+
+ AES_KEY kekEncCtx;
+ AES_KEY kekDecCtx;
+ CMAC_CTX* ickCtx;
+ CMAC_CTX* cakCtx;
+
+ // Create the CAK openssl context
+ cakCtx = CMAC_CTX_new();
+
+ CMAC_Init(cakCtx, CAK.data(), CAK.size(),
+ CAK.size() == 16 ? EVP_aes_128_cbc() : EVP_aes_256_cbc(), NULL);
+
+ // derive KEK from CAK (ieee802_1x_kek_aes_cmac)
+ std::vector<uint8_t> kek;
+ kek.resize(CAK.size());
+
+ aes_kdf(cakCtx, "IEEE8021 KEK", (const uint8_t*)ckn.data(), ckn.size() * 8, 8 * kek.size(),
+ kek.data());
+
+ AES_set_encrypt_key(kek.data(), kek.size() << 3, &kekEncCtx);
+ AES_set_decrypt_key(kek.data(), kek.size() << 3, &kekDecCtx);
+
+ // derive ICK from CAK (ieee802_1x_ick_aes_cmac)
+ std::vector<uint8_t> ick;
+ ick.resize(CAK.size());
+
+ aes_kdf(cakCtx, "IEEE8021 ICK", (const uint8_t*)CKN.data(), CKN.size() * 8, 8 * ick.size(),
+ ick.data());
+
+ ickCtx = CMAC_CTX_new();
+
+ CMAC_Init(ickCtx, ick.data(), ick.size(),
+ ick.size() == 16 ? EVP_aes_128_cbc() : EVP_aes_256_cbc(), NULL);
+
+ mKeys.push_back({keyId, kekEncCtx, kekDecCtx, ickCtx, cakCtx});
+
+ return ok();
+}
+
+ndk::ScopedAStatus MacsecPskPlugin::calcIcv(const std::vector<uint8_t>& keyId,
+ const std::vector<uint8_t>& data,
+ std::vector<uint8_t>* out) {
+ CMAC_CTX* ctx = NULL;
+
+ for (auto s : mKeys) {
+ if (s.keyId == keyId) {
+ ctx = s.ickCtx;
+ break;
+ }
+ }
+
+ if (ctx == NULL) {
+ return resultToStatus(EX_ILLEGAL_ARGUMENT, "Key not exist");
+ }
+
+ out->resize(16);
+ if (omac1_aes(ctx, data.data(), data.size(), out->data()) != 0) {
+ return resultToStatus(EX_SERVICE_SPECIFIC, "Internal error");
+ }
+
+ return ok();
+}
+
+ndk::ScopedAStatus MacsecPskPlugin::generateSak(const std::vector<uint8_t>& keyId,
+ const std::vector<uint8_t>& data,
+ const int sakLength, std::vector<uint8_t>* out) {
+ CMAC_CTX* ctx = NULL;
+
+ if ((sakLength != 16) && (sakLength != 32)) {
+ return resultToStatus(EX_ILLEGAL_ARGUMENT, "Invalid SAK length");
+ }
+
+ if (data.size() < sakLength) {
+ return resultToStatus(EX_ILLEGAL_ARGUMENT, "Invalid data length");
+ }
+
+ for (auto s : mKeys) {
+ if (s.keyId == keyId) {
+ ctx = s.cakCtx;
+ break;
+ }
+ }
+
+ if (ctx == NULL) {
+ return resultToStatus(EX_ILLEGAL_ARGUMENT, "Key not exist");
+ }
+
+ out->resize(sakLength);
+
+ if (aes_kdf(ctx, "IEEE8021 SAK", data.data(), data.size() * 8, out->size() * 8, out->data()) !=
+ 0) {
+ return resultToStatus(EX_SERVICE_SPECIFIC, "Internal error");
+ }
+
+ return ok();
+}
+
+ndk::ScopedAStatus MacsecPskPlugin::wrapSak(const std::vector<uint8_t>& keyId,
+ const std::vector<uint8_t>& sak,
+ std::vector<uint8_t>* out) {
+ if (sak.size() == 0 || sak.size() % 8 != 0) {
+ return resultToStatus(EX_ILLEGAL_ARGUMENT,
+ "SAK length not multiple of 8 or greater than 0");
+ }
+
+ AES_KEY* ctx = NULL;
+
+ for (auto s : mKeys) {
+ if (s.keyId == keyId) {
+ ctx = &s.kekEncCtx;
+ break;
+ }
+ }
+
+ if (ctx == NULL) {
+ return resultToStatus(EX_ILLEGAL_ARGUMENT, "Key not exist");
+ }
+
+ out->resize(sak.size() + 8);
+
+ if (AES_wrap_key(ctx, NULL, out->data(), sak.data(), sak.size()) > 0) {
+ return ok();
+ }
+
+ return resultToStatus(EX_SERVICE_SPECIFIC, "Internal error");
+}
+
+ndk::ScopedAStatus MacsecPskPlugin::unwrapSak(const std::vector<uint8_t>& keyId,
+ const std::vector<uint8_t>& sak,
+ std::vector<uint8_t>* out) {
+ if (sak.size() <= 8 || sak.size() % 8 != 0) {
+ return resultToStatus(EX_ILLEGAL_ARGUMENT,
+ "SAK length not multiple of 8 or greater than 0");
+ }
+
+ AES_KEY* ctx = NULL;
+
+ for (auto s : mKeys) {
+ if (s.keyId == keyId) {
+ ctx = &s.kekDecCtx;
+ break;
+ }
+ }
+
+ if (ctx == NULL) {
+ return resultToStatus(EX_ILLEGAL_ARGUMENT, "Key not exist");
+ }
+
+ out->resize(sak.size() - 8);
+
+ if (AES_unwrap_key(ctx, NULL, out->data(), sak.data(), sak.size()) > 0) {
+ return ok();
+ }
+
+ return resultToStatus(EX_SERVICE_SPECIFIC, "Internal error");
+}
+
+} // namespace aidl::android::hardware::macsec
diff --git a/macsec/aidl/default/MacsecPskPlugin.h b/macsec/aidl/default/MacsecPskPlugin.h
new file mode 100644
index 0000000..0b056e3
--- /dev/null
+++ b/macsec/aidl/default/MacsecPskPlugin.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright 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 <aidl/android/hardware/macsec/BnMacsecPskPlugin.h>
+
+#include <openssl/aes.h>
+#include <openssl/cmac.h>
+
+namespace aidl::android::hardware::macsec {
+
+struct keys {
+ std::vector<uint8_t> keyId;
+ AES_KEY kekEncCtx;
+ AES_KEY kekDecCtx;
+ CMAC_CTX* ickCtx;
+ CMAC_CTX* cakCtx;
+};
+
+class MacsecPskPlugin : public BnMacsecPskPlugin {
+ public:
+ MacsecPskPlugin();
+ ~MacsecPskPlugin();
+ ndk::ScopedAStatus addTestKey(const std::vector<uint8_t>& keyId,
+ const std::vector<uint8_t>& CAK,
+ const std::vector<uint8_t>& CKN) override;
+ ndk::ScopedAStatus calcIcv(const std::vector<uint8_t>& keyId, const std::vector<uint8_t>& data,
+ std::vector<uint8_t>* out) override;
+
+ ndk::ScopedAStatus generateSak(const std::vector<uint8_t>& keyId,
+ const std::vector<uint8_t>& data, const int sakLength,
+ std::vector<uint8_t>* out);
+
+ ndk::ScopedAStatus wrapSak(const std::vector<uint8_t>& keyId, const std::vector<uint8_t>& sak,
+ std::vector<uint8_t>* out) override;
+
+ ndk::ScopedAStatus unwrapSak(const std::vector<uint8_t>& keyId, const std::vector<uint8_t>& sak,
+ std::vector<uint8_t>* out) override;
+
+ private:
+ std::vector<struct keys> mKeys;
+};
+} // namespace aidl::android::hardware::macsec
diff --git a/macsec/aidl/default/android.hardware.macsec.rc b/macsec/aidl/default/android.hardware.macsec.rc
new file mode 100644
index 0000000..0ff0e53
--- /dev/null
+++ b/macsec/aidl/default/android.hardware.macsec.rc
@@ -0,0 +1,3 @@
+service android.hardware.macsec /vendor/bin/hw/android.hardware.macsec-service
+ class early_hal
+ user nobody
diff --git a/macsec/aidl/default/android.hardware.macsec.xml b/macsec/aidl/default/android.hardware.macsec.xml
new file mode 100644
index 0000000..9cf9e5a
--- /dev/null
+++ b/macsec/aidl/default/android.hardware.macsec.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 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.
+-->
+
+<manifest version="1.0" type="device">
+ <hal format="aidl">
+ <name>android.hardware.macsec</name>
+ <version>1</version>
+ <interface>
+ <name>IMacsecPskPlugin</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+</manifest>
diff --git a/macsec/aidl/default/fuzzer/fuzzer.cpp b/macsec/aidl/default/fuzzer/fuzzer.cpp
new file mode 100644
index 0000000..d912a67
--- /dev/null
+++ b/macsec/aidl/default/fuzzer/fuzzer.cpp
@@ -0,0 +1,27 @@
+/*
+ * 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 <fuzzbinder/libbinder_ndk_driver.h>
+#include <fuzzer/FuzzedDataProvider.h>
+#include "MacsecPskPlugin.h"
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+ std::shared_ptr<aidl::android::hardware::macsec::MacsecPskPlugin> service =
+ ndk::SharedRefBase::make<aidl::android::hardware::macsec::MacsecPskPlugin>();
+ android::fuzzService(service->asBinder().get(), FuzzedDataProvider(data, size));
+
+ return 0;
+}
diff --git a/macsec/aidl/default/service.cpp b/macsec/aidl/default/service.cpp
new file mode 100644
index 0000000..faf3a09
--- /dev/null
+++ b/macsec/aidl/default/service.cpp
@@ -0,0 +1,43 @@
+/*
+ * Copyright 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 "MacsecPskPlugin.h"
+
+#include <android-base/logging.h>
+#include <android/binder_manager.h>
+#include <android/binder_process.h>
+
+namespace android::hardware::macsec {
+
+using namespace std::string_literals;
+using ::aidl::android::hardware::macsec::MacsecPskPlugin;
+
+extern "C" int main() {
+ base::SetDefaultTag("MacsecPskPlugin");
+ base::SetMinimumLogSeverity(base::VERBOSE);
+
+ LOG(VERBOSE) << "Starting up...";
+ auto service = ndk::SharedRefBase::make<MacsecPskPlugin>();
+ const auto instance = MacsecPskPlugin::descriptor + "/default"s;
+ const auto status = AServiceManager_addService(service->asBinder().get(), instance.c_str());
+ CHECK_EQ(status, STATUS_OK) << "Failed to add service " << instance;
+ LOG(VERBOSE) << "Started successfully!";
+
+ ABinderProcess_joinThreadPool();
+ LOG(FATAL) << "MacsecPskPlugin exited unexpectedly!";
+ return EXIT_FAILURE;
+}
+} // namespace android::hardware::macsec
diff --git a/macsec/aidl/vts/functional/Android.bp b/macsec/aidl/vts/functional/Android.bp
new file mode 100644
index 0000000..0c8f43d
--- /dev/null
+++ b/macsec/aidl/vts/functional/Android.bp
@@ -0,0 +1,48 @@
+//
+// 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 {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "hardware_interfaces_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+cc_test {
+ name: "VtsHalMacsecPskPluginV1Test",
+ defaults: [
+ "VtsHalTargetTestDefaults",
+ "use_libaidlvintf_gtest_helper_static",
+ ],
+ cpp_std: "experimental",
+ srcs: [
+ "MacsecAidlTest.cpp",
+ ],
+ shared_libs: [
+ "libbase",
+ "libbinder_ndk",
+ ],
+ static_libs: [
+ "android.hardware.macsec-V1-ndk",
+ "libgmock",
+ ],
+ test_suites: [
+ "general-tests",
+ "vts",
+ ],
+}
diff --git a/macsec/aidl/vts/functional/MacsecAidlTest.cpp b/macsec/aidl/vts/functional/MacsecAidlTest.cpp
new file mode 100644
index 0000000..e94c049
--- /dev/null
+++ b/macsec/aidl/vts/functional/MacsecAidlTest.cpp
@@ -0,0 +1,142 @@
+/*
+ * 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 <aidl/Gtest.h>
+#include <aidl/Vintf.h>
+#include <aidl/android/hardware/macsec/IMacsecPskPlugin.h>
+#include <android-base/logging.h>
+#include <android/binder_manager.h>
+#include <gtest/gtest.h>
+
+#include <chrono>
+#include <thread>
+
+using aidl::android::hardware::macsec::IMacsecPskPlugin;
+using namespace std::chrono_literals;
+using namespace std::string_literals;
+
+const std::vector<uint8_t> CAK_ID_1 = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01};
+const std::vector<uint8_t> CAK_KEY_1 = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
+ 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF};
+const std::vector<uint8_t> CKN_1 = {0x31, 0x32, 0x33, 0x34}; // maximum 16 bytes
+const std::vector<uint8_t> SAK_DATA_1 = {0x31, 0x32, 0x33, 0x34, 0x11, 0x12, 0x12, 0x14,
+ 0x31, 0x32, 0x33, 0x34, 0x11, 0x12, 0x12, 0x14};
+const std::vector<uint8_t> SAK_1 = {0x13, 0xD9, 0xEE, 0x5B, 0x26, 0x8B, 0x44, 0xFB,
+ 0x37, 0x63, 0x3D, 0x41, 0xC8, 0xE7, 0x0D, 0x93};
+const std::vector<uint8_t> WRAPPED_SAK_1 = {0x3B, 0x39, 0xAB, 0x4C, 0xD8, 0xDA, 0x2E, 0xC5,
+ 0xD1, 0x38, 0x6A, 0x13, 0x9D, 0xE3, 0x78, 0xD9,
+ 0x93, 0xD2, 0xA0, 0x70, 0x88, 0xCB, 0xF5, 0xEC};
+const std::vector<uint8_t> DATA_1 = {0x31, 0x32, 0x33, 0x34, 0x31, 0x32, 0x34, 0x29,
+ 0x51, 0x52, 0x53, 0x54, 0x51, 0x35, 0x54, 0x59};
+const std::vector<uint8_t> ICV_1 = {0xDF, 0x54, 0xFF, 0xCD, 0xE0, 0xA9, 0x78, 0x10,
+ 0x6B, 0x7B, 0xD2, 0xBF, 0xEF, 0xD9, 0x0C, 0x81};
+
+const std::vector<uint8_t> CAK_ID_2 = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02};
+const std::vector<uint8_t> CAK_KEY_2 = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
+ 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
+ 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
+ 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF};
+const std::vector<uint8_t> CKN_2 = {0x35, 0x36, 0x37, 0x38}; // maximum 16 bytes
+const std::vector<uint8_t> SAK_DATA_2 = {0x31, 0x32, 0x33, 0x34, 0x31, 0x32, 0x33, 0x34,
+ 0x31, 0x32, 0x33, 0x34, 0x31, 0x32, 0x33, 0x34,
+ 0x31, 0x32, 0x33, 0x34, 0x31, 0x32, 0x33, 0x34,
+ 0x31, 0x32, 0x33, 0x34, 0x31, 0x32, 0x33, 0x34};
+const std::vector<uint8_t> SAK_2 = {0x39, 0x09, 0x36, 0x60, 0x18, 0x07, 0x2B, 0x5D,
+ 0xF0, 0x81, 0x81, 0x45, 0xCD, 0x71, 0xC6, 0xBA,
+ 0x1D, 0x2B, 0x87, 0xC4, 0xEF, 0x79, 0x68, 0x82,
+ 0x28, 0xD0, 0x25, 0x86, 0xD3, 0x63, 0xFF, 0x89};
+const std::vector<uint8_t> WRAPPED_SAK_2 = {
+ 0x2f, 0x6a, 0x22, 0x29, 0x68, 0x0e, 0x6e, 0x35, 0x91, 0x64, 0x05, 0x4a, 0x31, 0x8d,
+ 0x35, 0xea, 0x95, 0x85, 0x40, 0xc6, 0xea, 0x55, 0xe5, 0xc5, 0x68, 0x40, 0xae, 0x4d,
+ 0x6f, 0xeb, 0x73, 0xcd, 0x4e, 0x2a, 0x43, 0xb1, 0xda, 0x49, 0x4f, 0x0a};
+const std::vector<uint8_t> DATA_2 = {0x71, 0x82, 0x13, 0x24, 0x31, 0x82, 0xA4, 0x2F,
+ 0x51, 0x52, 0x53, 0x44, 0x21, 0x35, 0x54, 0x59};
+const std::vector<uint8_t> ICV_2 = {0x8D, 0xF1, 0x1D, 0x6E, 0xAC, 0x62, 0xC1, 0x2A,
+ 0xE8, 0xF8, 0x4E, 0xB1, 0x00, 0x45, 0x9A, 0xAD};
+
+class MacsecAidlTest : public ::testing::TestWithParam<std::string> {
+ public:
+ virtual void SetUp() override {
+ android::base::SetDefaultTag("MACSEC_HAL_VTS");
+ android::base::SetMinimumLogSeverity(android::base::VERBOSE);
+ const auto instance = IMacsecPskPlugin::descriptor + "/default"s;
+ mMacsecPskPluginService = IMacsecPskPlugin::fromBinder(
+ ndk::SpAIBinder(AServiceManager_waitForService(instance.c_str())));
+
+ ASSERT_NE(mMacsecPskPluginService, nullptr);
+ auto aidlStatus = mMacsecPskPluginService->addTestKey(CAK_ID_1, CAK_KEY_1, CKN_1);
+ ASSERT_TRUE(aidlStatus.isOk());
+ aidlStatus = mMacsecPskPluginService->addTestKey(CAK_ID_2, CAK_KEY_2, CKN_2);
+ ASSERT_TRUE(aidlStatus.isOk());
+ }
+ virtual void TearDown() override {}
+
+ std::shared_ptr<IMacsecPskPlugin> mMacsecPskPluginService;
+};
+
+TEST_P(MacsecAidlTest, calcIcv) {
+ std::vector<uint8_t> out;
+ auto aidlStatus = mMacsecPskPluginService->calcIcv(CAK_ID_1, DATA_1, &out);
+ ASSERT_TRUE(aidlStatus.isOk()) << "calcIcv KEY 1 failed: " << aidlStatus.getMessage();
+ EXPECT_EQ(out, ICV_1);
+
+ aidlStatus = mMacsecPskPluginService->calcIcv(CAK_ID_2, DATA_2, &out);
+ ASSERT_TRUE(aidlStatus.isOk()) << "calcIcv KEY 2 failed: " << aidlStatus.getMessage();
+ EXPECT_EQ(out, ICV_2);
+}
+
+TEST_P(MacsecAidlTest, generateSak) {
+ std::vector<uint8_t> out;
+ auto aidlStatus = mMacsecPskPluginService->generateSak(CAK_ID_1, SAK_DATA_1, 16, &out);
+ ASSERT_TRUE(aidlStatus.isOk()) << "generateSak KEY 1 failed: " << aidlStatus.getMessage();
+ EXPECT_EQ(out, SAK_1);
+
+ aidlStatus = mMacsecPskPluginService->generateSak(CAK_ID_2, SAK_DATA_2, 32, &out);
+ ASSERT_TRUE(aidlStatus.isOk()) << "generateSak KEY 2 failed: " << aidlStatus.getMessage();
+ EXPECT_EQ(out, SAK_2);
+}
+
+TEST_P(MacsecAidlTest, wrapSak) {
+ std::vector<uint8_t> out;
+ auto aidlStatus = mMacsecPskPluginService->wrapSak(CAK_ID_1, SAK_1, &out);
+ ASSERT_TRUE(aidlStatus.isOk()) << "wrapSak KEY 1 failed: " << aidlStatus.getMessage();
+ EXPECT_EQ(out, WRAPPED_SAK_1);
+
+ aidlStatus = mMacsecPskPluginService->wrapSak(CAK_ID_2, SAK_2, &out);
+ ASSERT_TRUE(aidlStatus.isOk()) << "wrapSak KEY 2 failed: " << aidlStatus.getMessage();
+ EXPECT_EQ(out, WRAPPED_SAK_2);
+}
+
+TEST_P(MacsecAidlTest, unwrapSak) {
+ std::vector<uint8_t> out;
+ auto aidlStatus = mMacsecPskPluginService->unwrapSak(CAK_ID_1, WRAPPED_SAK_1, &out);
+ ASSERT_TRUE(aidlStatus.isOk()) << "unwrapSak KEY 1 failed: " << aidlStatus.getMessage();
+ EXPECT_EQ(out, SAK_1);
+
+ aidlStatus = mMacsecPskPluginService->unwrapSak(CAK_ID_2, WRAPPED_SAK_2, &out);
+ ASSERT_TRUE(aidlStatus.isOk()) << "unwrapSak KEY 2 failed: " << aidlStatus.getMessage();
+ EXPECT_EQ(out, SAK_2);
+}
+
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(MacsecAidlTest);
+INSTANTIATE_TEST_SUITE_P(
+ PerInstance, MacsecAidlTest,
+ testing::ValuesIn(android::getAidlHalInstanceNames(IMacsecPskPlugin::descriptor)),
+ android::PrintInstanceNameToString);
diff --git a/macsec/aidl/vts/functional/OWNERS b/macsec/aidl/vts/functional/OWNERS
new file mode 100644
index 0000000..5009a88
--- /dev/null
+++ b/macsec/aidl/vts/functional/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 533426
+keithmok@google.com
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSession.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSession.aidl
index 45c8002..2150fbe 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSession.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSession.aidl
@@ -42,4 +42,6 @@
oneway void stopDtmf();
oneway void sendHeaderExtension(in List<android.hardware.radio.ims.media.RtpHeaderExtension> extensions);
oneway void setMediaQualityThreshold(in android.hardware.radio.ims.media.MediaQualityThreshold threshold);
+ oneway void requestRtpReceptionStats(in int intervalMs);
+ oneway void adjustDelay(in int delayMs);
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl
index 5ec9c18..87474ef 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl
@@ -42,4 +42,5 @@
oneway void triggerAnbrQuery(in android.hardware.radio.ims.media.RtpConfig config);
oneway void onDtmfReceived(char dtmfDigit, int durationMs);
oneway void onCallQualityChanged(in android.hardware.radio.ims.media.CallQuality callQuality);
+ oneway void notifyRtpReceptionStats(in android.hardware.radio.ims.media.RtpReceptionStats stats);
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpReceptionStats.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpReceptionStats.aidl
new file mode 100644
index 0000000..82b798b
--- /dev/null
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpReceptionStats.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.radio.ims.media;
+@VintfStability
+parcelable RtpReceptionStats {
+ int rtpTimestamp;
+ int rtpSequenceNumber;
+ int timeDurationMs;
+ int jitterBufferMs;
+ int roundTripTimeMs;
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SuggestedAction.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SuggestedAction.aidl
index 120e7e8..6dbf09d 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SuggestedAction.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SuggestedAction.aidl
@@ -38,4 +38,6 @@
NONE,
TRIGGER_PLMN_BLOCK,
TRIGGER_PLMN_BLOCK_WITH_TIMEOUT,
+ TRIGGER_RAT_BLOCK,
+ TRIGGER_CLEAR_RAT_BLOCK,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/ConnectionEvent.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/ConnectionEvent.aidl
new file mode 100644
index 0000000..3161322
--- /dev/null
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/ConnectionEvent.aidl
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.radio.network;
+/* @hide */
+@Backing(type="int") @JavaDerive(toString=true) @VintfStability
+enum ConnectionEvent {
+ CS_SERVICE_GSM = 0,
+ SIGNALLING_GSM = 1,
+ PS_SERVICE_GPRS = 2,
+ SIGNALLING_GPRS = 3,
+ PS_SERVICE_3G = 4,
+ SIGNALLING_3G = 5,
+ NAS_SIGNALLING_LTE = 6,
+ AS_SIGNALLING_LTE = 7,
+ VOLTE_SIP = 8,
+ VOLTE_RTP = 9,
+ NAS_SIGNALLING_5G = 10,
+ AS_SIGNALLING_5G = 11,
+ VONR_SIP = 12,
+ VONR_RTP = 13,
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetwork.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetwork.aidl
index 35badb7..8af617f 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetwork.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetwork.aidl
@@ -84,4 +84,6 @@
oneway void setN1ModeEnabled(in int serial, boolean enable);
oneway void isCellularIdentifierTransparencyEnabled(in int serial);
oneway void setCellularIdentifierTransparencyEnabled(in int serial, in boolean enabled);
+ oneway void setSecurityAlgorithmsUpdatedEnabled(in int serial, boolean enable);
+ oneway void isSecurityAlgorithmsUpdatedEnabled(in int serial);
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkIndication.aidl
index 77729f3..8eea14f 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkIndication.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkIndication.aidl
@@ -51,4 +51,5 @@
oneway void voiceRadioTechChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.RadioTechnology rat);
oneway void emergencyNetworkScanResult(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.EmergencyRegResult result);
oneway void cellularIdentifierDisclosed(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.CellularIdentifierDisclosure disclosure);
+ oneway void securityAlgorithmsUpdated(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.SecurityAlgorithmUpdate securityAlgorithmUpdate);
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkResponse.aidl
index 91502d0..e7f2918 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkResponse.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkResponse.aidl
@@ -83,4 +83,6 @@
oneway void setN1ModeEnabledResponse(in android.hardware.radio.RadioResponseInfo info);
oneway void isCellularIdentifierTransparencyEnabledResponse(in android.hardware.radio.RadioResponseInfo info, boolean isEnabled);
oneway void setCellularIdentifierTransparencyEnabledResponse(in android.hardware.radio.RadioResponseInfo info);
+ oneway void setSecurityAlgorithmsUpdatedEnabledResponse(in android.hardware.radio.RadioResponseInfo info);
+ oneway void isSecurityAlgorithmsUpdatedEnabledResponse(in android.hardware.radio.RadioResponseInfo info, in boolean isEnabled);
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SecurityAlgorithm.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SecurityAlgorithm.aidl
new file mode 100644
index 0000000..97ce004
--- /dev/null
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SecurityAlgorithm.aidl
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.radio.network;
+/* @hide */
+@Backing(type="int") @JavaDerive(toString=true) @VintfStability
+enum SecurityAlgorithm {
+ A50 = 0,
+ A51 = 1,
+ A52 = 2,
+ A53 = 3,
+ A54 = 4,
+ GEA0 = 14,
+ GEA1 = 15,
+ GEA2 = 16,
+ GEA3 = 17,
+ GEA4 = 18,
+ GEA5 = 19,
+ UEA0 = 29,
+ UEA1 = 30,
+ UEA2 = 31,
+ EEA0 = 41,
+ EEA1 = 42,
+ EEA2 = 43,
+ EEA3 = 44,
+ EEA4_ZUC = 45,
+ NEA0 = 55,
+ NEA1 = 56,
+ NEA2 = 57,
+ NEA3 = 58,
+ SIP_NULL = 68,
+ AES_GCM = 69,
+ AES_GMAC = 70,
+ AES_CBC = 71,
+ DES_EDE3_CBC = 72,
+ AES_EDE3_CBC = 73,
+ HMAC_SHA1_96 = 74,
+ HMAC_SHA1_96_null = 75,
+ HMAC_MD5_96 = 76,
+ HMAC_MD5_96_null = 77,
+ SRTP_AES_COUNTER = 87,
+ SRTP_AES_F8 = 88,
+ SRTP_HMAC_SHA1 = 89,
+ ENCR_AES_GCM_16 = 99,
+ ENCR_AES_CBC = 100,
+ AUTH_HMAC_SHA2_256_128 = 101,
+ UNKNOWN = 113,
+ OTHER = 114,
+ ORYX = 124,
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SecurityAlgorithmUpdate.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SecurityAlgorithmUpdate.aidl
new file mode 100644
index 0000000..73ad180
--- /dev/null
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SecurityAlgorithmUpdate.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.radio.network;
+/* @hide */
+@JavaDerive(toString=true) @VintfStability
+parcelable SecurityAlgorithmUpdate {
+ android.hardware.radio.network.ConnectionEvent connectionEvent;
+ android.hardware.radio.network.SecurityAlgorithm encryption;
+ android.hardware.radio.network.SecurityAlgorithm integrity;
+ boolean isUnprotectedEmergency;
+}
diff --git a/radio/aidl/android/hardware/radio/config/IRadioConfig.aidl b/radio/aidl/android/hardware/radio/config/IRadioConfig.aidl
index 1075ef7..9058d9d 100644
--- a/radio/aidl/android/hardware/radio/config/IRadioConfig.aidl
+++ b/radio/aidl/android/hardware/radio/config/IRadioConfig.aidl
@@ -40,6 +40,8 @@
*
* Response callback is
* IRadioConfigResponse.getHalDeviceCapabilitiesResponse()
+ *
+ * This is available when android.hardware.telephony is defined.
*/
void getHalDeviceCapabilities(in int serial);
@@ -54,6 +56,8 @@
*
* Response callback is IRadioConfigResponse.getNumOfLiveModemsResponse() which
* will return <byte>.
+ *
+ * This is available when android.hardware.telephony is defined.
*/
void getNumOfLiveModems(in int serial);
@@ -64,6 +68,8 @@
*
* Response callback is IRadioResponse.getPhoneCapabilityResponse() which
* will return <PhoneCapability>.
+ *
+ * This is available when android.hardware.telephony is defined.
*/
void getPhoneCapability(in int serial);
@@ -76,6 +82,8 @@
* @param serial Serial number of request.
*
* Response callback is IRadioConfigResponse.getSimSlotsStatusResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void getSimSlotsStatus(in int serial);
@@ -93,6 +101,8 @@
* @param modemsConfig byte object including the number of live modems
*
* Response callback is IRadioResponse.setNumOfLiveModemsResponse()
+ *
+ * This is available when android.hardware.telephony is defined.
*/
void setNumOfLiveModems(in int serial, in byte numOfLiveModems);
@@ -107,6 +117,8 @@
* from getPhoneCapability().
*
* Response callback is IRadioConfigResponse.setPreferredDataModemResponse()
+ *
+ * This is available when android.hardware.telephony.data is defined.
*/
void setPreferredDataModem(in int serial, in byte modemId);
@@ -115,6 +127,8 @@
*
* @param radioConfigResponse Object containing radio config response functions
* @param radioConfigIndication Object containing radio config indications
+ *
+ * This is available when android.hardware.telephony is defined.
*/
void setResponseFunctions(in IRadioConfigResponse radioConfigResponse,
in IRadioConfigIndication radioConfigIndication);
@@ -173,6 +187,8 @@
* getSimSlotsStatusResponse
*
* Response callback is IRadioConfigResponse.setSimSlotsMappingResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void setSimSlotsMapping(in int serial, in SlotPortMapping[] slotMap);
}
diff --git a/radio/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl b/radio/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl
index cb3533e..df93e3c 100644
--- a/radio/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl
+++ b/radio/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl
@@ -40,6 +40,7 @@
* IRadioIndication.currentPhysicalChannelConfigs_1_6()
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -53,6 +54,7 @@
* are enabled and actively working as part of a working connectivity stack
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
*/
@@ -65,6 +67,7 @@
* how many logical modems it has, how many data connections it supports.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -78,6 +81,8 @@
* equal to the number of physical slots on the device
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:NO_MEMORY
@@ -91,6 +96,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -101,6 +107,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.data is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -112,6 +119,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:NO_MEMORY
diff --git a/radio/aidl/android/hardware/radio/data/IRadioData.aidl b/radio/aidl/android/hardware/radio/data/IRadioData.aidl
index 519d425..a73616a 100644
--- a/radio/aidl/android/hardware/radio/data/IRadioData.aidl
+++ b/radio/aidl/android/hardware/radio/data/IRadioData.aidl
@@ -48,6 +48,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioDataResponse.allocatePduSessionIdResponse()
+ *
+ * This is available when android.hardware.telephony.data is defined.
*/
void allocatePduSessionId(in int serial);
@@ -60,6 +62,8 @@
* @param id callId The identifier of the data call which is provided in SetupDataCallResult
*
* Response function is IRadioDataResponse.cancelHandoverResponse()
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void cancelHandover(in int serial, in int callId);
@@ -73,6 +77,8 @@
* @param reason The request reason. Must be normal, handover, or shutdown.
*
* Response function is IRadioDataResponse.deactivateDataCallResponse()
+ *
+ * This is available when android.hardware.telephony.data is defined.
*/
void deactivateDataCall(in int serial, in int cid, in DataRequestReason reason);
@@ -83,6 +89,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioDataResponse.getDataCallListResponse()
+ *
+ * This is available when android.hardware.telephony.data is defined.
*/
void getDataCallList(in int serial);
@@ -96,6 +104,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioDataResponse.getSlicingConfigResponse()
+ *
+ * This is available when android.hardware.telephony.data is defined.
*/
void getSlicingConfig(in int serial);
@@ -107,6 +117,8 @@
* @param id Pdu session id to release.
*
* Response function is IRadioDataResponse.releasePduSessionIdResponse()
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void releasePduSessionId(in int serial, in int id);
@@ -114,6 +126,8 @@
* When response type received from a radio indication or radio response is
* RadioIndicationType:UNSOLICITED_ACK_EXP or RadioResponseType:SOLICITED_ACK_EXP respectively,
* acknowledge the receipt of those messages by sending responseAcknowledgement().
+ *
+ * This is available when android.hardware.telephony.data is defined.
*/
void responseAcknowledgement();
@@ -124,6 +138,8 @@
* @param allow true to allow data calls, false to disallow data calls
*
* Response function is IRadioDataResponse.setDataAllowedResponse()
+ *
+ * This is available when android.hardware.telephony.data is defined.
*/
void setDataAllowed(in int serial, in boolean allow);
@@ -134,6 +150,8 @@
* @param profiles Array of DataProfileInfo to set.
*
* Response function is IRadioDataResponse.setDataProfileResponse()
+ *
+ * This is available when android.hardware.telephony.data is defined.
*/
void setDataProfile(in int serial, in DataProfileInfo[] profiles);
@@ -155,6 +173,8 @@
* DataThrottlingAction:HOLD.
*
* Response function is IRadioDataResponse.setDataThrottlingResponse()
+ *
+ * This is available when android.hardware.telephony.data is defined.
*/
void setDataThrottling(in int serial, in DataThrottlingAction dataThrottlingAction,
in long completionDurationMillis);
@@ -167,6 +187,8 @@
* initial attach APN.
*
* Response function is IRadioDataResponse.setInitialAttachApnResponse()
+ *
+ * This is available when android.hardware.telephony.data is defined.
*/
void setInitialAttachApn(in int serial, in @nullable DataProfileInfo dataProfileInfo);
@@ -175,6 +197,8 @@
*
* @param radioDataResponse Object containing response functions
* @param radioDataIndication Object containing radio indications
+ *
+ * This is available when android.hardware.telephony.data is defined.
*/
void setResponseFunctions(
in IRadioDataResponse radioDataResponse, in IRadioDataIndication radioDataIndication);
@@ -229,6 +253,8 @@
* example, a zero-rating slice.
*
* Response function is IRadioDataResponse.setupDataCallResponse()
+ *
+ * This is available when android.hardware.telephony.data is defined.
*/
void setupDataCall(in int serial, in AccessNetwork accessNetwork,
in DataProfileInfo dataProfileInfo, in boolean roamingAllowed,
@@ -250,6 +276,8 @@
* @param id callId The identifier of the data call which is provided in SetupDataCallResult
*
* Response function is IRadioDataResponse.startHandoverResponse()
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void startHandover(in int serial, in int callId);
@@ -260,6 +288,8 @@
* @param keepalive A request structure containing all necessary info to describe a keepalive
*
* Response function is IRadioDataResponse.startKeepaliveResponse()
+ *
+ * This is available when android.hardware.telephony.data is defined.
*/
void startKeepalive(in int serial, in KeepaliveRequest keepalive);
@@ -271,6 +301,8 @@
* IRadioDataResponse.startKeepaliveResponse
*
* Response function is IRadioDataResponse.stopKeepaliveResponse()
+ *
+ * This is available when android.hardware.telephony.data is defined.
*/
void stopKeepalive(in int serial, in int sessionHandle);
}
diff --git a/radio/aidl/android/hardware/radio/data/IRadioDataResponse.aidl b/radio/aidl/android/hardware/radio/data/IRadioDataResponse.aidl
index b714844..538b90a 100644
--- a/radio/aidl/android/hardware/radio/data/IRadioDataResponse.aidl
+++ b/radio/aidl/android/hardware/radio/data/IRadioDataResponse.aidl
@@ -41,6 +41,7 @@
* @param id The allocated id. On an error, this is set to 0.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.data is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -53,6 +54,7 @@
* @param dcResponse Attributes of data call
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.ims is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -65,6 +67,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.data is not defined
* RadioError:NONE indicates success. Any other error will remove the network from the list.
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_CALL_ID
@@ -83,6 +86,7 @@
* @param dcResponse List of SetupDataCallResult
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.data is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -95,6 +99,7 @@
* @param slicingConfig Current slicing configuration
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.data is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -106,6 +111,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.ims is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -117,6 +123,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.data is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:NO_MEMORY
@@ -135,6 +142,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.data is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SUBSCRIPTION_NOT_AVAILABLE
@@ -150,6 +158,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.data is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:MODEM_ERR
@@ -161,6 +170,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.data is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SUBSCRIPTION_NOT_AVAILABLE
@@ -180,6 +190,7 @@
* @param dcResponse SetupDataCallResult
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.data is not defined
* RadioError:NONE must be returned on both success and failure of setup with the
* DataCallResponse.status containing the actual status
* For all other errors the DataCallResponse is ignored.
@@ -197,6 +208,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.ims is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -212,6 +224,7 @@
* request.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.data is not defined
* RadioError:NONE
* RadioError:NO_RESOURCES
* RadioError:INVALID_ARGUMENTS
@@ -222,6 +235,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.data is not defined
* RadioError:NONE
* RadioError:INVALID_ARGUMENTS
*/
diff --git a/radio/aidl/android/hardware/radio/ims/IRadioIms.aidl b/radio/aidl/android/hardware/radio/ims/IRadioIms.aidl
index 05d6035..90792f7 100644
--- a/radio/aidl/android/hardware/radio/ims/IRadioIms.aidl
+++ b/radio/aidl/android/hardware/radio/ims/IRadioIms.aidl
@@ -45,6 +45,8 @@
* @param srvccCalls the list of calls
*
* Response function is IRadioImsResponse.setSrvccCallInfoResponse()
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void setSrvccCallInfo(int serial, in SrvccCall[] srvccCalls);
@@ -60,6 +62,8 @@
* @param imsRegistration IMS registration information
*
* Response function is IRadioImsResponse.updateImsRegistrationInfoResponse()
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void updateImsRegistrationInfo(int serial, in ImsRegistration imsRegistration);
@@ -90,6 +94,8 @@
* mobile terminated use case eg. MO/MT call/SMS etc
*
* Response function is IRadioImsResponse.startImsTrafficResponse()
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void startImsTraffic(int serial, int token, ImsTrafficType imsTrafficType,
AccessNetwork accessNetworkType, ImsCall.Direction trafficDirection);
@@ -103,6 +109,8 @@
* @param token The token assigned by startImsTraffic()
*
* Response function is IRadioImsResponse.stopImsTrafficResponse()
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void stopImsTraffic(int serial, int token);
@@ -114,6 +122,8 @@
* @param reason Specifies the reason that causes EPS fallback
*
* Response function is IRadioImsResponse.triggerEpsFallbackResponse()
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void triggerEpsFallback(int serial, in EpsFallbackReason reason);
@@ -122,6 +132,8 @@
*
* @param radioImsResponse Object containing response functions
* @param radioImsIndication Object containing radio indications
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void setResponseFunctions(
in IRadioImsResponse radioImsResponse, in IRadioImsIndication radioImsIndication);
@@ -137,6 +149,8 @@
* @param bitsPerSecond The bit rate requested by the opponent UE
*
* Response function is IRadioImsResponse.sendAnbrQueryResponse()
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void sendAnbrQuery(
int serial, ImsStreamType mediaType, ImsStreamDirection direction, int bitsPerSecond);
@@ -148,6 +162,8 @@
* @param imsCalls The list of IMS calls
*
* Response function is IRadioImsResponse.updateImsCallStatusResponse()
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void updateImsCallStatus(int serial, in ImsCall[] imsCalls);
}
diff --git a/radio/aidl/android/hardware/radio/ims/IRadioImsResponse.aidl b/radio/aidl/android/hardware/radio/ims/IRadioImsResponse.aidl
index b8a5a94..ca33d07 100644
--- a/radio/aidl/android/hardware/radio/ims/IRadioImsResponse.aidl
+++ b/radio/aidl/android/hardware/radio/ims/IRadioImsResponse.aidl
@@ -29,6 +29,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.ims is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_STATE
@@ -45,6 +46,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.ims is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_STATE
@@ -63,6 +65,7 @@
* it should be {@code null}.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.ims is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_STATE
@@ -80,6 +83,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.ims is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_STATE
@@ -96,6 +100,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.ims is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_STATE
@@ -112,6 +117,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.ims is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_STATE
@@ -128,6 +134,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.ims is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_STATE
diff --git a/radio/aidl/android/hardware/radio/ims/SuggestedAction.aidl b/radio/aidl/android/hardware/radio/ims/SuggestedAction.aidl
index 443042d..f0e28fc 100644
--- a/radio/aidl/android/hardware/radio/ims/SuggestedAction.aidl
+++ b/radio/aidl/android/hardware/radio/ims/SuggestedAction.aidl
@@ -35,4 +35,18 @@
* management timer value as per the carrier requirements.
*/
TRIGGER_PLMN_BLOCK_WITH_TIMEOUT,
+ /**
+ * Indicates that the IMS registration on current RAT failed multiple times.
+ * The radio shall block the current RAT and search for other available RATs in the
+ * background. If no other RAT is available that meets the carrier requirements, the
+ * radio may remain on the current RAT for internet service. The radio clears all
+ * RATs marked as unavailable if {@link IRadioIms#updateImsRegistrationInfo()} API
+ * with REGISTERED state is invoked.
+ */
+ TRIGGER_RAT_BLOCK,
+ /**
+ * Indicates that the radio clears all RATs marked as unavailable and tries to find
+ * an available RAT that meets the carrier requirements.
+ */
+ TRIGGER_CLEAR_RAT_BLOCK,
}
diff --git a/radio/aidl/android/hardware/radio/ims/media/IImsMedia.aidl b/radio/aidl/android/hardware/radio/ims/media/IImsMedia.aidl
index 0af86c7..14fe68b 100644
--- a/radio/aidl/android/hardware/radio/ims/media/IImsMedia.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/IImsMedia.aidl
@@ -31,6 +31,8 @@
* Set the listener functions for receiving notifications from the RTP stack.
*
* @param mediaListener Object containing listener methods
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void setListener(in IImsMediaListener mediaListener);
@@ -46,6 +48,8 @@
* @param localEndPoint provides IP address, port and logical modem id for local RTP endpoint
* @param config provides remote end point info and codec details. This could be null initially
* and the application may update this later using modifySession() API.
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void openSession(int sessionId, in LocalEndPoint localEndPoint, in RtpConfig config);
@@ -54,6 +58,8 @@
* This shall also close the session specific binder connection opened as part of openSession().
*
* @param sessionId identifier for the rtp session that needs to be closed
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void closeSession(int sessionId);
}
diff --git a/radio/aidl/android/hardware/radio/ims/media/IImsMediaSession.aidl b/radio/aidl/android/hardware/radio/ims/media/IImsMediaSession.aidl
index deb741b..0fe6740 100644
--- a/radio/aidl/android/hardware/radio/ims/media/IImsMediaSession.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/IImsMediaSession.aidl
@@ -32,6 +32,8 @@
* Set the listener functions to receive IMS media session specific notifications.
*
* @param sessionListener Object containing notification methods
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void setListener(in IImsMediaSessionListener sessionListener);
@@ -40,6 +42,8 @@
* the media stream by changing the value of the MediaDirection.
*
* @param config provides remote end point info and codec details
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void modifySession(in RtpConfig config);
@@ -48,6 +52,8 @@
*
* @param dtmfDigit single char having one of 12 values: 0-9, *, #
* @param duration of the key press in milliseconds.
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void sendDtmf(char dtmfDigit, int duration);
@@ -57,12 +63,16 @@
* stopDtmf() is not received yet, then that digit must be stopped first
*
* @param dtmfDigit single char having one of 12 values: 0-9, *, #
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void startDtmf(char dtmfDigit);
/**
* Stop sending the last DTMF digit started by startDtmf().
* stopDtmf() without preceding startDtmf() must be ignored.
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void stopDtmf();
@@ -70,6 +80,8 @@
* Send RTP header extension to the other party in the next RTP packet.
*
* @param extensions data to be transmitted via RTP header extension
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void sendHeaderExtension(in List<RtpHeaderExtension> extensions);
@@ -78,6 +90,30 @@
* media quality notifications.
*
* @param threshold media quality thresholds for various quality parameters
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void setMediaQualityThreshold(in MediaQualityThreshold threshold);
+
+ /**
+ * Queries the current RTP reception statistics of the RTP stream. It will trigger the
+ IImsMediaSessionListener#notifyRtpReceptionStats(RtpReceptionStats).
+ *
+ * @param intervalMs The interval of the time in milliseconds of the RTP reception
+ * notification. When it is zero, the report is disabled.
+ *
+ * This is available when android.hardware.telephony.ims is defined.
+ */
+ void requestRtpReceptionStats(in int intervalMs);
+
+ /**
+ * Adjust the delay in the jitter buffer to synchronize the audio with the time of video
+ * frames
+ *
+ * @param delayMs The delay to apply to the jitter buffer. If it is positive, the jitter
+ * buffer increases the delay, if it is negative, the jitter buffer decreases the delay.
+ *
+ * This is available when android.hardware.telephony.ims is defined.
+ */
+ void adjustDelay(in int delayMs);
}
diff --git a/radio/aidl/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl b/radio/aidl/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl
index 442c018..d3d0b26 100644
--- a/radio/aidl/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl
@@ -21,6 +21,7 @@
import android.hardware.radio.ims.media.RtpConfig;
import android.hardware.radio.ims.media.RtpError;
import android.hardware.radio.ims.media.RtpHeaderExtension;
+import android.hardware.radio.ims.media.RtpReceptionStats;
/**
* Interface declaring listener functions for unsolicited IMS media notifications per session.
@@ -37,6 +38,8 @@
* RtpError :INTERNAL_ERR
* RtpError :NO_MEMORY
* RtpError :NO_RESOURCES
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void onModifySessionResponse(in RtpConfig config, RtpError error);
@@ -49,6 +52,8 @@
* packets from the most recently added config.
*
* @param config The remote config where the media is received
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void onFirstMediaPacketReceived(in RtpConfig config);
@@ -56,6 +61,8 @@
* RTP header extension received from the other party
*
* @param extensions content of the received RTP header extension
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void onHeaderExtensionReceived(in List<RtpHeaderExtension> extensions);
@@ -64,6 +71,8 @@
* {@link MediaQualityThreshold} set by {@link IImsMediaSession#setMediaQualityThreshold()}.
*
* @param quality The object of MediaQualityStatus with the rtp and the rtcp statistics.
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void notifyMediaQualityStatus(in MediaQualityStatus quality);
@@ -73,6 +82,8 @@
* See 3GPP TS 26.114.
*
* @param config containing desired bitrate and direction
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void triggerAnbrQuery(in RtpConfig config);
@@ -81,6 +92,8 @@
*
* @param dtmfDigit single char having one of 12 values: 0-9, *, #
* @param durationMs The duration to play the tone in milliseconds unit
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void onDtmfReceived(char dtmfDigit, int durationMs);
@@ -88,6 +101,18 @@
* Notifies when a change to call quality has occurred
*
* @param CallQuality The call quality statistics of ongoing call since last report
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void onCallQualityChanged(in CallQuality callQuality);
+
+ /**
+ * Notifies the RTP reception statistics periodically after
+ * IImsMediaSession#requestRtpReceptionStats(intervalMs) is invoked.
+ *
+ * @param stats The RTP reception statistics
+ *
+ * This is available when android.hardware.telephony.ims is defined.
+ */
+ void notifyRtpReceptionStats(in RtpReceptionStats stats);
}
diff --git a/radio/aidl/android/hardware/radio/ims/media/RtpReceptionStats.aidl b/radio/aidl/android/hardware/radio/ims/media/RtpReceptionStats.aidl
new file mode 100644
index 0000000..1239d13
--- /dev/null
+++ b/radio/aidl/android/hardware/radio/ims/media/RtpReceptionStats.aidl
@@ -0,0 +1,31 @@
+/*
+ * 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.radio.ims.media;
+
+@VintfStability
+parcelable RtpReceptionStats {
+ /** The timestamp of the latest RTP packet received */
+ int rtpTimestamp;
+ /** The sequence number of latest RTP packet received */
+ int rtpSequenceNumber;
+ /** The system clock time in millisecond of latest RTP packet received */
+ int timeDurationMs;
+ /** The jitter buffer size in millisecond when latest RTP packet received */
+ int jitterBufferMs;
+ /** The round trip time delay in millisecond when latest RTP packet received */
+ int roundTripTimeMs;
+}
diff --git a/radio/aidl/android/hardware/radio/messaging/IRadioMessaging.aidl b/radio/aidl/android/hardware/radio/messaging/IRadioMessaging.aidl
index 44818ff..945453c 100644
--- a/radio/aidl/android/hardware/radio/messaging/IRadioMessaging.aidl
+++ b/radio/aidl/android/hardware/radio/messaging/IRadioMessaging.aidl
@@ -50,6 +50,8 @@
* @param ackPdu acknowledgement TPDU in hexadecimal format
*
* Response function is IRadioMessagingResponse.acknowledgeIncomingGsmSmsWithPduResponse()
+ *
+ * This is available when android.hardware.telephony.messaging is defined.
*/
void acknowledgeIncomingGsmSmsWithPdu(in int serial, in boolean success, in String ackPdu);
@@ -61,6 +63,8 @@
* @param smsAck Cdma Sms ack to be sent described by CdmaSmsAck
*
* Response function is IRadioMessagingResponse.acknowledgeLastIncomingCdmaSmsResponse()
+ *
+ * This is available when android.hardware.telephony.cdma is defined.
*/
void acknowledgeLastIncomingCdmaSms(in int serial, in CdmaSmsAck smsAck);
@@ -75,6 +79,8 @@
* in TS 23.040, 9.2.3.22.
*
* Response function is IRadioMessagingResponse.acknowledgeLastIncomingGsmSmsResponse()
+ *
+ * This is available when android.hardware.telephony.messaging is defined.
*/
void acknowledgeLastIncomingGsmSms(
in int serial, in boolean success, in SmsAcknowledgeFailCause cause);
@@ -86,6 +92,8 @@
* @param index record index of the message to delete
*
* Response function is IRadioMessagingResponse.deleteSmsOnRuimResponse()
+ *
+ * This is available when android.hardware.telephony.cdma is defined.
*/
void deleteSmsOnRuim(in int serial, in int index);
@@ -96,6 +104,8 @@
* @param index Record index of the message to delete.
*
* Response function is IRadioMessagingResponse.deleteSmsOnSimResponse()
+ *
+ * This is available when android.hardware.telephony.messaging is defined.
*/
void deleteSmsOnSim(in int serial, in int index);
@@ -105,6 +115,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioMessagingResponse.getCdmaBroadcastConfigResponse()
+ *
+ * This is available when android.hardware.telephony.cdma is defined.
*/
void getCdmaBroadcastConfig(in int serial);
@@ -114,6 +126,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioMessagingResponse.getGsmBroadcastConfigResponse()
+ *
+ * This is available when android.hardware.telephony.messaging is defined.
*/
void getGsmBroadcastConfig(in int serial);
@@ -123,6 +137,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioMessagingResponse.getSmscAddressResponse()
+ *
+ * This is available when android.hardware.telephony.messaging is defined.
*/
void getSmscAddress(in int serial);
@@ -134,6 +150,8 @@
* false if memory capacity is exceeded
*
* Response function is IRadioMessagingResponse.reportSmsMemoryStatusResponse()
+ *
+ * This is available when android.hardware.telephony.messaging is defined.
*/
void reportSmsMemoryStatus(in int serial, in boolean available);
@@ -141,6 +159,8 @@
* When response type received from a radio indication or radio response is
* RadioIndicationType:UNSOLICITED_ACK_EXP or RadioResponseType:SOLICITED_ACK_EXP respectively,
* acknowledge the receipt of those messages by sending responseAcknowledgement().
+ *
+ * This is available when android.hardware.telephony.messaging is defined.
*/
void responseAcknowledgement();
@@ -151,6 +171,8 @@
* @param sms CdmaSmsMessage to be sent
*
* Response function is IRadioMessagingResponse.sendCdmaSmsResponse()
+ *
+ * This is available when android.hardware.telephony.cdma is defined.
*/
void sendCdmaSms(in int serial, in CdmaSmsMessage sms);
@@ -162,6 +184,8 @@
* @param sms CdmaSmsMessage to be sent
*
* Response function is IRadioMessagingResponse.sendCdmaSmsExpectMoreResponse()
+ *
+ * This is available when android.hardware.telephony.cdma is defined.
*/
void sendCdmaSmsExpectMore(in int serial, in CdmaSmsMessage sms);
@@ -174,6 +198,8 @@
* @param message ImsSmsMessage to be sent
*
* Response function is IRadioMessagingResponse.sendImsSmsResponse()
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void sendImsSms(in int serial, in ImsSmsMessage message);
@@ -186,6 +212,8 @@
* @param message GsmSmsMessage to be sent
*
* Response function is IRadioMessagingResponse.sendSmsResponse()
+ *
+ * This is available when android.hardware.telephony.messaging is defined.
*/
void sendSms(in int serial, in GsmSmsMessage message);
@@ -200,6 +228,8 @@
* @param message GsmSmsMessage to be sent
*
* Response function is IRadioMessagingResponse.sendSmsExpectMoreResponse()
+ *
+ * This is available when android.hardware.telephony.messaging is defined.
*/
void sendSmsExpectMore(in int serial, in GsmSmsMessage message);
@@ -211,6 +241,8 @@
* true = activate, false = turn off
*
* Response function is IRadioMessagingResponse.setCdmaBroadcastActivationResponse()
+ *
+ * This is available when android.hardware.telephony.cdma is defined.
*/
void setCdmaBroadcastActivation(in int serial, in boolean activate);
@@ -221,6 +253,8 @@
* @param configInfo CDMA Broadcast SMS config to be set.
*
* Response function is IRadioMessagingResponse.setCdmaBroadcastConfigResponse()
+ *
+ * This is available when android.hardware.telephony.cdma is defined.
*/
void setCdmaBroadcastConfig(in int serial, in CdmaBroadcastSmsConfigInfo[] configInfo);
@@ -232,6 +266,8 @@
* Cell Broadcast SMS. true = activate, false = turn off
*
* Response function is IRadioMessagingResponse.setGsmBroadcastActivationResponse()
+ *
+ * This is available when android.hardware.telephony.messaging is defined.
*/
void setGsmBroadcastActivation(in int serial, in boolean activate);
@@ -242,6 +278,8 @@
* @param configInfo Setting of GSM/WCDMA Cell broadcast config
*
* Response function is IRadioMessagingResponse.setGsmBroadcastConfigResponse()
+ *
+ * This is available when android.hardware.telephony.messaging is defined.
*/
void setGsmBroadcastConfig(in int serial, in GsmBroadcastSmsConfigInfo[] configInfo);
@@ -250,6 +288,8 @@
*
* @param radioMessagingResponse Object containing response functions
* @param radioMessagingIndication Object containing radio indications
+ *
+ * This is available when android.hardware.telephony.messaging is defined.
*/
void setResponseFunctions(in IRadioMessagingResponse radioMessagingResponse,
in IRadioMessagingIndication radioMessagingIndication);
@@ -261,6 +301,8 @@
* @param smsc Short Message Service Center address to set
*
* Response function is IRadioMessagingResponse.setSmscAddressResponse()
+ *
+ * This is available when android.hardware.telephony.messaging is defined.
*/
void setSmscAddress(in int serial, in String smsc);
@@ -271,6 +313,8 @@
* @param cdmaSms CdmaSmsWriteArgs
*
* Response function is IRadioMessagingResponse.writeSmsToRuimResponse()
+ *
+ * This is available when android.hardware.telephony.cdma is defined.
*/
void writeSmsToRuim(in int serial, in CdmaSmsWriteArgs cdmaSms);
@@ -281,6 +325,8 @@
* @param smsWriteArgs SmsWriteArgs
*
* Response function is IRadioMessagingResponse.writeSmsToSimResponse()
+ *
+ * This is available when android.hardware.telephony.messaging is defined.
*/
void writeSmsToSim(in int serial, in SmsWriteArgs smsWriteArgs);
}
diff --git a/radio/aidl/android/hardware/radio/messaging/IRadioMessagingResponse.aidl b/radio/aidl/android/hardware/radio/messaging/IRadioMessagingResponse.aidl
index 84c34ca..f0d7999 100644
--- a/radio/aidl/android/hardware/radio/messaging/IRadioMessagingResponse.aidl
+++ b/radio/aidl/android/hardware/radio/messaging/IRadioMessagingResponse.aidl
@@ -31,6 +31,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.messaging is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -44,6 +46,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.cdma is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -66,6 +69,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.messaging is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -88,6 +93,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.cdma is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -109,6 +115,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.messaging is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SIM_FULL
@@ -131,6 +139,7 @@
* @param configs Vector of CDMA Broadcast SMS configs.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.cdma is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -153,6 +162,8 @@
* @param configs Vector of GSM/WCDMA Cell broadcast configs
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.messaging is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -175,6 +186,8 @@
* @param smsc Short Message Service Center address on the device
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.messaging is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -196,6 +209,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.messaging is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -216,6 +231,7 @@
* @param sms Response to sms sent as defined by SendSmsResult
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.cdma is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SMS_SEND_FAIL_RETRY
@@ -249,6 +265,7 @@
* @param sms Sms result struct as defined by SendSmsResult
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.cdma is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -282,6 +299,7 @@
* @param sms Response to sms sent as defined by SendSmsResult
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.ims is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SMS_SEND_FAIL_RETRY
@@ -309,6 +327,8 @@
* @param sms Response to sms sent as defined by SendSmsResult
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.messaging is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SMS_SEND_FAIL_RETRY
@@ -341,6 +361,8 @@
* @param sms Response to sms sent as defined by SendSmsResult
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.messaging is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SMS_SEND_FAIL_RETRY
@@ -371,6 +393,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.cdma is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -391,6 +414,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.cdma is not
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -410,6 +434,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.messaging is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -430,6 +456,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.messaging is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -449,6 +477,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.messaging is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -471,6 +501,7 @@
* @param index record index where the cmda sms message is stored
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.cdma is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -497,6 +528,8 @@
* @param index record index where the message is stored
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.messaging is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SIM_FULL
diff --git a/radio/aidl/android/hardware/radio/modem/IRadioModem.aidl b/radio/aidl/android/hardware/radio/modem/IRadioModem.aidl
index 0d51584..bfca5a9 100644
--- a/radio/aidl/android/hardware/radio/modem/IRadioModem.aidl
+++ b/radio/aidl/android/hardware/radio/modem/IRadioModem.aidl
@@ -48,6 +48,8 @@
* @param on True to turn on the logical modem, otherwise turn it off.
*
* Response function is IRadioModemResponse.enableModemResponse()
+ *
+ * This is available when android.hardware.telephony is defined.
*/
void enableModem(in int serial, in boolean on);
@@ -57,6 +59,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioModemResponse.getBasebandVersionResponse()
+ *
+ * This is available when android.hardware.telephony is defined.
*/
void getBasebandVersion(in int serial);
@@ -68,6 +72,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioModemResponse.getDeviceIdentityResponse()
+ *
+ * This is available when android.hardware.telephony is defined.
* @deprecated use getImei(int serial)
*/
void getDeviceIdentity(in int serial);
@@ -78,6 +84,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioModemResponse.getHardwareConfigResponse()
+ *
+ * This is available when android.hardware.telephony is defined.
*/
void getHardwareConfig(in int serial);
@@ -89,6 +97,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioModemResponse.getModemActivityInfoResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void getModemActivityInfo(in int serial);
@@ -99,6 +109,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioModemResponse.getModemStackStatusResponse()
+ *
+ * This is available when android.hardware.telephony is defined.
*/
void getModemStackStatus(in int serial);
@@ -108,6 +120,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioModemResponse.getRadioCapabilityResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void getRadioCapability(in int serial);
@@ -146,6 +160,8 @@
*
* Response function is IRadioModemResponse.nvWriteCdmaPrlResponse()
*
+ * This is available when android.hardware.telephony.cdma is defined.
+ *
* @deprecated NV APIs are deprecated starting from Android U.
*/
void nvWriteCdmaPrl(in int serial, in byte[] prl);
@@ -170,6 +186,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioModemResponse.requestShutdownResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void requestShutdown(in int serial);
@@ -177,6 +195,8 @@
* When response type received from a radio indication or radio response is
* RadioIndicationType:UNSOLICITED_ACK_EXP or RadioResponseType:SOLICITED_ACK_EXP respectively,
* acknowledge the receipt of those messages by sending responseAcknowledgement().
+ *
+ * This is available when android.hardware.telephony is defined.
*/
void responseAcknowledgement();
@@ -189,6 +209,8 @@
* @param state The updated state. See the definition of state at DeviceStateType.
*
* Response function is IRadioModemResponse.sendDeviceStateResponse()
+ *
+ * This is available when android.hardware.telephony is defined.
*/
void sendDeviceState(in int serial, in DeviceStateType deviceStateType, in boolean state);
@@ -201,6 +223,8 @@
* @param rc RadioCapability structure to be set
*
* Response function is IRadioModemResponse.setRadioCapabilityResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setRadioCapability(in int serial, in RadioCapability rc);
@@ -225,6 +249,8 @@
* on this modem or not. No effect if forEmergencyCall is false, or powerOn is false.
*
* Response function is IRadioConfigResponse.setRadioPowerResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setRadioPower(in int serial, in boolean powerOn, in boolean forEmergencyCall,
in boolean preferredForEmergencyCall);
@@ -234,6 +260,8 @@
*
* @param radioModemResponse Object containing response functions
* @param radioModemIndication Object containing radio indications
+ *
+ * This is available when android.hardware.telephony is defined.
*/
void setResponseFunctions(in IRadioModemResponse radioModemResponse,
in IRadioModemIndication radioModemIndication);
@@ -244,6 +272,8 @@
* @param serial : Serial number of request.
*
* Response function is IRadioModemResponse.getImeiResponse()
+ *
+ * This is available when android.hardware.telephony.gsm is defined.
*/
void getImei(in int serial);
}
diff --git a/radio/aidl/android/hardware/radio/modem/IRadioModemResponse.aidl b/radio/aidl/android/hardware/radio/modem/IRadioModemResponse.aidl
index b6946f3..6d2504c 100644
--- a/radio/aidl/android/hardware/radio/modem/IRadioModemResponse.aidl
+++ b/radio/aidl/android/hardware/radio/modem/IRadioModemResponse.aidl
@@ -41,6 +41,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:MODEM_ERR
@@ -55,6 +56,7 @@
* @param version string containing version string for log reporting
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:EMPTY_RECORD
@@ -79,6 +81,7 @@
* accessing the device.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:NO_MEMORY
@@ -100,6 +103,7 @@
* @param config Array of HardwareConfig of the radio.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
*/
@@ -110,6 +114,8 @@
* @param activityInfo modem activity information
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:NO_MEMORY
@@ -126,6 +132,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:MODEM_ERR
@@ -137,6 +144,8 @@
* @param rc Radio capability as defined by RadioCapability in types.hal
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:OPERATION_NOT_ALLOWED
@@ -175,6 +184,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.cdma is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
*
@@ -197,6 +207,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:OPERATION_NOT_ALLOWED
@@ -212,6 +224,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:NO_MEMORY
@@ -229,6 +242,8 @@
* feedback return status
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE means a unsol radioCapability() will be sent within 30 seconds.
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:OPERATION_NOT_ALLOWED
@@ -247,6 +262,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:INTERNAL_ERR
* RadioError:INVALID_ARGUMENTS
@@ -265,6 +282,7 @@
* @param imeiInfo IMEI information
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.gsm is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:MODEM_ERR
diff --git a/radio/aidl/android/hardware/radio/network/ConnectionEvent.aidl b/radio/aidl/android/hardware/radio/network/ConnectionEvent.aidl
new file mode 100644
index 0000000..639ba89
--- /dev/null
+++ b/radio/aidl/android/hardware/radio/network/ConnectionEvent.aidl
@@ -0,0 +1,55 @@
+/*
+ * Copyright 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.radio.network;
+
+/**
+ * See IRadioNetwork.securityAlgorithmsUpdated for more details.
+ *
+ * @hide
+ */
+@VintfStability
+@Backing(type="int")
+@JavaDerive(toString=true)
+enum ConnectionEvent {
+ // 2G GSM
+ CS_SERVICE_GSM = 0,
+ SIGNALLING_GSM = 1,
+
+ // 2G GPRS packet services
+ PS_SERVICE_GPRS = 2,
+ SIGNALLING_GPRS = 3,
+
+ // 3G packet services
+ PS_SERVICE_3G = 4,
+ SIGNALLING_3G = 5,
+
+ // 4G LTE packet services
+ NAS_SIGNALLING_LTE = 6,
+ AS_SIGNALLING_LTE = 7,
+
+ // VoLTE
+ VOLTE_SIP = 8,
+ VOLTE_RTP = 9,
+
+ // 5G packet services
+ NAS_SIGNALLING_5G = 10,
+ AS_SIGNALLING_5G = 11,
+
+ // VoNR
+ VONR_SIP = 12,
+ VONR_RTP = 13,
+}
diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl
index 806eed9..32890ec 100644
--- a/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl
+++ b/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl
@@ -48,6 +48,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.getAllowedNetworkTypesBitmapResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void getAllowedNetworkTypesBitmap(in int serial);
@@ -57,6 +59,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.getAvailableBandModesResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void getAvailableBandModes(in int serial);
@@ -66,6 +70,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.getAvailableNetworksResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void getAvailableNetworks(in int serial);
@@ -75,6 +81,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.getBarringInfoResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void getBarringInfo(in int serial);
@@ -84,6 +92,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.getCdmaRoamingPreferenceResponse()
+ *
+ * This is available when android.hardware.telephony.cdma is defined.
*/
void getCdmaRoamingPreference(in int serial);
@@ -96,6 +106,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.getCellInfoListResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void getCellInfoList(in int serial);
@@ -105,6 +117,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.getDataRegistrationStateResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void getDataRegistrationState(in int serial);
@@ -115,6 +129,8 @@
*
* Response function is IRadioNetworkResponse.getImsRegistrationStateResponse()
*
+ * This is available when android.hardware.telephony.ims is defined.
+ *
* @deprecated Deprecated starting from Android U.
*/
void getImsRegistrationState(in int serial);
@@ -125,6 +141,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.getNetworkSelectionModeResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void getNetworkSelectionMode(in int serial);
@@ -134,6 +152,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.getOperatorResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void getOperator(in int serial);
@@ -143,6 +163,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.getSignalStrengthResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void getSignalStrength(in int serial);
@@ -152,6 +174,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.getSystemSelectionChannelsResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void getSystemSelectionChannels(in int serial);
@@ -162,6 +186,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.getVoiceRadioTechnologyResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void getVoiceRadioTechnology(in int serial);
@@ -171,6 +197,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.getVoiceRegistrationStateResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void getVoiceRegistrationState(in int serial);
@@ -180,6 +208,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.isNrDualConnectivityEnabledResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void isNrDualConnectivityEnabled(in int serial);
@@ -187,6 +217,8 @@
* When response type received from a radio indication or radio response is
* RadioIndicationType:UNSOLICITED_ACK_EXP or RadioResponseType:SOLICITED_ACK_EXP respectively,
* acknowledge the receipt of those messages by sending responseAcknowledgement().
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void responseAcknowledgement();
@@ -199,6 +231,8 @@
* @param networkTypeBitmap a 32-bit bearer bitmap of RadioAccessFamily
*
* Response function is IRadioNetworkResponse.setAllowedNetworkTypesBitmapResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setAllowedNetworkTypesBitmap(in int serial, in int networkTypeBitmap);
@@ -209,6 +243,8 @@
* @param mode RadioBandMode
*
* Response function is IRadioNetworkResponse.setBandModeResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setBandMode(in int serial, in RadioBandMode mode);
@@ -221,6 +257,8 @@
* @param newPassword new password
*
* Response function is IRadioNetworkResponse.setBarringPasswordResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setBarringPassword(
in int serial, in String facility, in String oldPassword, in String newPassword);
@@ -232,6 +270,8 @@
* @param type CdmaRoamingType defined in types.hal
*
* Response function is IRadioNetworkResponse.setCdmaRoamingPreferenceResponse()
+ *
+ * This is available when android.hardware.telephony.cdma is defined.
*/
void setCdmaRoamingPreference(in int serial, in CdmaRoamingType type);
@@ -244,6 +284,8 @@
* @param rate minimum time in milliseconds to indicate time between unsolicited cellInfoList()
*
* Response function is IRadioNetworkResponse.setCellInfoListRateResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setCellInfoListRate(in int serial, in int rate);
@@ -257,6 +299,8 @@
* indications are enabled. See IndicationFilter for the definition of each bit.
*
* Response function is IRadioNetworkResponse.setIndicationFilterResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setIndicationFilter(in int serial, in int indicationFilter);
@@ -281,6 +325,8 @@
* @param accessNetwork The type of network for which to apply these thresholds.
*
* Response function is IRadioNetworkResponse.setLinkCapacityReportingCriteriaResponse().
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setLinkCapacityReportingCriteria(in int serial, in int hysteresisMs,
in int hysteresisDlKbps, in int hysteresisUlKbps, in int[] thresholdsDownlinkKbps,
@@ -296,6 +342,8 @@
* @param enable true=updates enabled (+CREG=2), false=updates disabled (+CREG=1)
*
* Response function is IRadioNetworkResponse.setLocationUpdatesResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setLocationUpdates(in int serial, in boolean enable);
@@ -306,6 +354,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.setNetworkSelectionModeAutomaticResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setNetworkSelectionModeAutomatic(in int serial);
@@ -322,6 +372,8 @@
* the next best RAN for network registration.
*
* Response function is IRadioNetworkResponse.setNetworkSelectionModeManualResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setNetworkSelectionModeManual(
in int serial, in String operatorNumeric, in AccessNetwork ran);
@@ -338,6 +390,8 @@
* {NrDualConnectivityState:DISABLE_IMMEDIATE}
*
* Response function is IRadioNetworkResponse.setNrDualConnectivityStateResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setNrDualConnectivityState(
in int serial, in NrDualConnectivityState nrDualConnectivityState);
@@ -347,6 +401,8 @@
*
* @param radioNetworkResponse Object containing response functions
* @param radioNetworkIndication Object containing radio indications
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setResponseFunctions(in IRadioNetworkResponse radioNetworkResponse,
in IRadioNetworkIndication radioNetworkIndication);
@@ -365,6 +421,8 @@
* criteria. See SignalThresholdInfo for details.
*
* Response function is IRadioNetworkResponse.setSignalStrengthReportingCriteriaResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setSignalStrengthReportingCriteria(
in int serial, in SignalThresholdInfo[] signalThresholdInfos);
@@ -377,6 +435,8 @@
* @param enable true = notifications enabled, false = notifications disabled.
*
* Response function is IRadioNetworkResponse.setSuppServiceNotificationsResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void setSuppServiceNotifications(in int serial, in boolean enable);
@@ -390,6 +450,8 @@
* @param specifiers which bands to scan. Only used if specifyChannels is true.
*
* Response function is IRadioNetworkResponse.setSystemSelectionChannelsResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setSystemSelectionChannels(
in int serial, in boolean specifyChannels, in RadioAccessSpecifier[] specifiers);
@@ -401,6 +463,8 @@
* @param request Defines the radio networks/bands/channels which need to be scanned.
*
* Response function is IRadioNetworkResponse.startNetworkScanResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void startNetworkScan(in int serial, in NetworkScanRequest request);
@@ -410,6 +474,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.stopNetworkScanResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void stopNetworkScan(in int serial);
@@ -420,6 +486,8 @@
* @param netPin Network depersonlization code
*
* Response function is IRadioNetworkResponse.supplyNetworkDepersonalizationResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void supplyNetworkDepersonalization(in int serial, in String netPin);
@@ -432,6 +500,8 @@
*
* @param serial Serial number of request.
* @param usageSetting the usage setting for the current SIM.
+ *
+ * This is available when android.hardware.telephony is defined.
*/
oneway void setUsageSetting(in int serial, in UsageSetting usageSetting);
@@ -441,6 +511,8 @@
* <p>Gets the usage setting in accordance with 3gpp 24.301 sec 4.3 and 3gpp 24.501 sec 4.3.
*
* @param serial Serial number of request.
+ *
+ * This is available when android.hardware.telephony is defined.
*/
oneway void getUsageSetting(in int serial);
@@ -452,6 +524,8 @@
* type of service to be scanned.
*
* Response function is IRadioEmergencyResponse.setEmergencyModeResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setEmergencyMode(int serial, in EmergencyMode emcModeType);
@@ -463,6 +537,8 @@
* See {@link EmergencyNetworkScanTrigger}.
*
* Response function is IRadioEmergencyResponse.triggerEmergencyNetworkScanResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void triggerEmergencyNetworkScan(int serial, in EmergencyNetworkScanTrigger request);
@@ -475,6 +551,8 @@
* otherwise the modem shall resume from the last search.
*
* Response function is IRadioEmergencyResponse.cancelEmergencyNetworkScan()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void cancelEmergencyNetworkScan(int serial, boolean resetScan);
@@ -484,6 +562,8 @@
* @param serial Serial number of the request.
*
* Response function is IRadioEmergencyResponse.exitEmergencyModeResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void exitEmergencyMode(in int serial);
@@ -514,6 +594,8 @@
* Otherwise, false.
*
* Response callback is IRadioResponse.setNullCipherAndIntegrityEnabledResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setNullCipherAndIntegrityEnabled(in int serial, in boolean enabled);
@@ -529,6 +611,8 @@
* @param serial Serial number of the request.
*
* Response callback is IRadioNetworkResponse.isNullCipherAndIntegrityEnabledResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void isNullCipherAndIntegrityEnabled(in int serial);
@@ -538,6 +622,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.isN1ModeEnabledResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void isN1ModeEnabled(in int serial);
@@ -555,6 +641,8 @@
* @param enable {@code true} to enable N1 mode, {@code false} to disable N1 mode.
*
* Response function is IRadioNetworkResponse.setN1ModeEnabledResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setN1ModeEnabled(in int serial, boolean enable);
@@ -567,6 +655,8 @@
* @param serial Serial number of request
*
* Response callback is IRadioNetworkResponse.isCellularIdentifierTransparencyEnabledResponse
+ *
+ * This is available when android.hardware.telephony.access is defined.
*/
void isCellularIdentifierTransparencyEnabled(in int serial);
@@ -595,6 +685,36 @@
* clear
*
* Response function is IRadioNetworkResponse.setCellularIdentifierTransparencyEnabledResponse
+ *
+ * This is available when android.hardware.telephony.access is defined.
*/
void setCellularIdentifierTransparencyEnabled(in int serial, in boolean enabled);
+
+ /**
+ * Enables or disables security algorithm update reports via indication API
+ * {@link IRadioNetworkIndication.securityAlgorithmsUpdated()}.
+ *
+ * Note: The default value shall be enabled.
+ *
+ * @param serial Serial number of request.
+ * @param enable {@code true} to enable security algorithm update reports, {@code false} to
+ * disable.
+ *
+ * Response function is IRadioNetworkResponse.setSecurityAlgorithmsUpdatedEnabledResponse()
+ *
+ * This is available when android.hardware.telephony.access is defined.
+ */
+ void setSecurityAlgorithmsUpdatedEnabled(in int serial, boolean enable);
+
+ /**
+ * Checks whether security algorithm update reports are enabled via indication API
+ * {@link IRadioNetworkIndication.securityAlgorithmsUpdated()}.
+ *
+ * @param serial Serial number of request.
+ *
+ * Response function is IRadioNetworkResponse.isSecurityAlgorithmsUpdatedEnabledResponse()
+ *
+ * This is available when android.hardware.telephony.access is defined.
+ */
+ void isSecurityAlgorithmsUpdatedEnabled(in int serial);
}
diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl
index d7b5b3b..9c2502d 100644
--- a/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl
+++ b/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl
@@ -27,6 +27,7 @@
import android.hardware.radio.network.NetworkScanResult;
import android.hardware.radio.network.PhoneRestrictedState;
import android.hardware.radio.network.PhysicalChannelConfig;
+import android.hardware.radio.network.SecurityAlgorithmUpdate;
import android.hardware.radio.network.SignalStrength;
import android.hardware.radio.network.SuppSvcNotification;
@@ -209,16 +210,16 @@
* A non-exhaustive list of when this method should be called follows:
*
* - If a device attempts an IMSI attach to the network.
- * - If a device includes an IMSI in the IDENTITY_RESPONSE message on the NAS and a security context
- * has not yet been established.
+ * - If a device includes an IMSI in the IDENTITY_RESPONSE message on the NAS and a security
+ * context has not yet been established.
* - If a device includes an IMSI in a DETACH_REQUEST message sent on the NAS and the message is
* sent before a security context has been established.
- * - If a device includes an IMSI in a TRACKING_AREA_UPDATE message sent on the NAS and the message
- * is sent before a security context has been established.
+ * - If a device includes an IMSI in a TRACKING_AREA_UPDATE message sent on the NAS and the
+ * message is sent before a security context has been established.
* - If a device uses a 2G network to send a LOCATION_UPDATE_REQUEST message on the NAS that
* includes an IMSI or IMEI.
- * - If a device uses a 2G network to send a AUTHENTICATION_AND_CIPHERING_RESPONSE message on the
- * NAS and the message includes an IMEISV.
+ * - If a device uses a 2G network to send a AUTHENTICATION_AND_CIPHERING_RESPONSE message on
+ * the NAS and the message includes an IMEISV.
*
* @param type Type of radio indication
* @param disclosure A CellularIdentifierDisclosure as specified by
@@ -227,4 +228,24 @@
*/
void cellularIdentifierDisclosed(
in RadioIndicationType type, in CellularIdentifierDisclosure disclosure);
+
+ /*
+ * Indicates that a new ciphering or integrity algorithm was used for a particular voice,
+ * signaling, or data connection attempt for a given PLMN and/or access network. Due to
+ * power concerns, once a connection type has been reported on, follow-up reports about that
+ * connection type are only generated if there is any change to the previously reported
+ * encryption or integrity. Thus the AP is only to be notified when there is new information.
+ * List is reset upon rebooting thus info about initial connections is always passed to the
+ * AP after a reboot. List is also reset if the SIM is changed or if there has been a change
+ * in the access network.
+ *
+ * Note: a change only in cell ID should not trigger an update, as the design is intended to
+ * be agnostic to dual connectivity ("secondary serving cells").
+ *
+ * @param type Type of radio indication
+ * @param securityAlgorithmUpdate SecurityAlgorithmUpdate encapsulates details of security
+ * algorithm updates
+ */
+ void securityAlgorithmsUpdated(
+ in RadioIndicationType type, in SecurityAlgorithmUpdate securityAlgorithmUpdate);
}
diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl
index b8a258a..d9eea03 100644
--- a/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl
+++ b/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl
@@ -51,6 +51,8 @@
* @param networkTypeBitmap a 32-bit bitmap of RadioAccessFamily.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:OPERATION_NOT_ALLOWED
@@ -67,6 +69,8 @@
* @param bandModes List of RadioBandMode listing supported modes
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -84,6 +88,8 @@
* @param networkInfos List of network operator information as OperatorInfos
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:OPERATION_NOT_ALLOWED
@@ -104,6 +110,8 @@
* @param barringInfos a vector of barring info for all barring service types
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -117,6 +125,7 @@
* @param type CdmaRoamingType
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.cdma is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -135,6 +144,8 @@
* @param cellInfo List of current cell information known to radio
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -146,6 +157,8 @@
* @param dataRegResponse Current data registration response as defined by RegStateResult
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -160,6 +173,7 @@
* @param ratFamily RadioTechnologyFamily. This value is valid only if isRegistered is true.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.ims is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -178,6 +192,8 @@
* @param selection false for automatic selection, true for manual selection
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:NO_MEMORY
@@ -197,6 +213,8 @@
* @param numeric is 5 or 6 digit numeric code (MCC + MNC) or empty string if unregistered
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:NO_MEMORY
@@ -213,6 +231,8 @@
* @param signalStrength Current signal strength
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -224,6 +244,8 @@
* @param specifiers List of RadioAccessSpecifiers that are scanned.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -237,6 +259,8 @@
* @param rat Current voice RAT
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -251,6 +275,8 @@
* @param voiceRegResponse Current Voice registration response as defined by RegStateResult
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -264,6 +290,8 @@
* else false.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -274,6 +302,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:OPERATION_NOT_ALLOWED
@@ -289,6 +319,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:OPERATION_NOT_ALLOWED
@@ -306,6 +338,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SS_MODIFIED_TO_DIAL
@@ -326,6 +360,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.cdma is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:NO_MEMORY
@@ -344,6 +379,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:NO_MEMORY
@@ -359,6 +396,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE
@@ -371,6 +410,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE
@@ -382,6 +423,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:NO_MEMORY
@@ -399,6 +442,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:ILLEGAL_SIM_OR_ME
@@ -420,6 +465,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:ILLEGAL_SIM_OR_ME
@@ -442,6 +489,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -453,6 +502,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE
@@ -463,6 +514,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -481,6 +533,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -492,6 +546,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:DEVICE_IN_USE
@@ -505,6 +561,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:INTERNAL_ERR
* RadioError:MODEM_ERR
@@ -516,6 +574,8 @@
* @param remainingRetries Number of retries remaining, must be equal to -1 if unknown.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:PASSWORD_INCORRECT (code is invalid)
@@ -535,6 +595,7 @@
* @param info Response info struct containing response type, serial no. and error.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_STATE
@@ -549,6 +610,7 @@
* @param usageSetting the usage setting for the current SIM.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_STATE
@@ -565,6 +627,8 @@
* @param regState the current registration state of the modem.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:RADIO_NOT_AVAILABLE
@@ -580,6 +644,8 @@
* @param info Response info struct containing response type, serial no. and error.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:RADIO_NOT_AVAILABLE
@@ -595,6 +661,8 @@
* @param info Response info struct containing response type, serial no. and error.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:RADIO_NOT_AVAILABLE
@@ -609,6 +677,8 @@
* @param info Response info struct containing response type, serial no. and error.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:RADIO_NOT_AVAILABLE
@@ -620,6 +690,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:MODEM_ERR
@@ -631,6 +703,8 @@
* @param enabled the last known state of null ciphering and integrity algorithms
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:MODEM_ERR
@@ -645,6 +719,8 @@
* @param isEnabled Indicates whether N1 mode is enabled or not.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -659,6 +735,8 @@
* @param info Response info struct containing response type, serial no. and error.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -674,6 +752,8 @@
* @param isEnabled Indicates whether cellular identifier transparency is enabled or not.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -687,10 +767,43 @@
* @param info Response info struct containing response type, serial no. and error.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
* RadioError:INVALID_STATE
*/
void setCellularIdentifierTransparencyEnabledResponse(in RadioResponseInfo info);
+
+ /**
+ * Response of setSecurityAlgorithmsUpdatedEnabled.
+ *
+ * @param info Response info struct containing response type, serial no. and error.
+ *
+ * Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:INVALID_STATE
+ */
+ void setSecurityAlgorithmsUpdatedEnabledResponse(in RadioResponseInfo info);
+
+ /**
+ * Response of isSecurityAlgorithmsUpdatedEnabled.
+ *
+ * @param info Response info struct containing response type, serial no. and error.
+ * @param isEnabled Indicates whether cellular ciphering transparency is enabled or not.
+ *
+ * Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ */
+ void isSecurityAlgorithmsUpdatedEnabledResponse(
+ in RadioResponseInfo info, in boolean isEnabled);
}
diff --git a/radio/aidl/android/hardware/radio/network/SecurityAlgorithm.aidl b/radio/aidl/android/hardware/radio/network/SecurityAlgorithm.aidl
new file mode 100644
index 0000000..6d2c018
--- /dev/null
+++ b/radio/aidl/android/hardware/radio/network/SecurityAlgorithm.aidl
@@ -0,0 +1,91 @@
+/*
+ * Copyright 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.radio.network;
+
+/**
+ * See IRadioNetwork.securityAlgorithmsUpdated for more details.
+ *
+ * @hide
+ */
+@VintfStability
+@Backing(type="int")
+@JavaDerive(toString=true)
+enum SecurityAlgorithm {
+ // GSM CS services (3GPP TS 43.020)
+ A50 = 0,
+ A51 = 1,
+ A52 = 2,
+ A53 = 3,
+ A54 = 4,
+
+ // GPRS PS services (3GPP TS 43.020)
+ // These also refer to the respective integrity counterparts.
+ // E.g. GEA1 = GIA1
+ GEA0 = 14,
+ GEA1 = 15,
+ GEA2 = 16,
+ GEA3 = 17,
+ GEA4 = 18,
+ GEA5 = 19,
+
+ // 3G PS/CS services (3GPP TS 33.102)
+ UEA0 = 29,
+ UEA1 = 30,
+ UEA2 = 31,
+
+ // 4G PS services & 5G NSA (3GPP TS 33.401)
+ EEA0 = 41,
+ EEA1 = 42,
+ EEA2 = 43,
+ EEA3 = 44,
+ EEA4_ZUC = 45,
+
+ // 5G PS services (3GPP TS 33.401 for 5G NSA and 3GPP TS 33.501 for 5G SA)
+ NEA0 = 55,
+ NEA1 = 56,
+ NEA2 = 57,
+ NEA3 = 58,
+
+ // SIP layer security (See 3GPP TS 33.203)
+ SIP_NULL = 68,
+ AES_GCM = 69,
+ AES_GMAC = 70,
+ AES_CBC = 71,
+ DES_EDE3_CBC = 72,
+ AES_EDE3_CBC = 73,
+ HMAC_SHA1_96 = 74,
+ HMAC_SHA1_96_null = 75,
+ HMAC_MD5_96 = 76,
+ HMAC_MD5_96_null = 77,
+
+ // RTP (see 3GPP TS 33.328)
+ SRTP_AES_COUNTER = 87,
+ SRTP_AES_F8 = 88,
+ SRTP_HMAC_SHA1 = 89,
+
+ // ePDG (3GPP TS 33.402)
+ ENCR_AES_GCM_16 = 99,
+ ENCR_AES_CBC = 100,
+ AUTH_HMAC_SHA2_256_128 = 101,
+
+ /** Unknown */
+ UNKNOWN = 113,
+ OTHER = 114,
+
+ /** For proprietary algorithms */
+ ORYX = 124,
+}
diff --git a/radio/aidl/android/hardware/radio/network/SecurityAlgorithmUpdate.aidl b/radio/aidl/android/hardware/radio/network/SecurityAlgorithmUpdate.aidl
new file mode 100644
index 0000000..e945d3b
--- /dev/null
+++ b/radio/aidl/android/hardware/radio/network/SecurityAlgorithmUpdate.aidl
@@ -0,0 +1,48 @@
+/*
+ * Copyright 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.radio.network;
+
+import android.hardware.radio.network.ConnectionEvent;
+import android.hardware.radio.network.SecurityAlgorithm;
+
+/**
+ * A single occurrence capturing a notable change to previously reported
+ * cryptography algorithms for a given network and network event.
+ *
+ * @hide
+ */
+@JavaDerive(toString=true)
+@VintfStability
+parcelable SecurityAlgorithmUpdate {
+ /**
+ * Type of connection event which is being reported on
+ */
+ ConnectionEvent connectionEvent;
+ /**
+ * Encryption algorithm which was used
+ */
+ SecurityAlgorithm encryption;
+ /**
+ * Integrity algorithm which was used
+ */
+ SecurityAlgorithm integrity;
+ /**
+ * Whether or not this connection event is associated with an
+ * unauthenticated / unencrypted emergency session
+ */
+ boolean isUnprotectedEmergency;
+}
diff --git a/radio/aidl/android/hardware/radio/sap/ISap.aidl b/radio/aidl/android/hardware/radio/sap/ISap.aidl
index 552e602..04eee43 100644
--- a/radio/aidl/android/hardware/radio/sap/ISap.aidl
+++ b/radio/aidl/android/hardware/radio/sap/ISap.aidl
@@ -28,6 +28,8 @@
* @param serial Id to match req-resp. Resp must include same serial.
* @param type APDU command type
* @param command CommandAPDU/CommandAPDU7816 parameter depending on type
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void apduReq(in int serial, in SapApduType type, in byte[] command);
@@ -36,6 +38,8 @@
*
* @param serial Id to match req-resp. Resp must include same serial.
* @param maxMsgSizeBytes MaxMsgSize to be used for SIM Access Profile connection
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void connectReq(in int serial, in int maxMsgSizeBytes);
@@ -43,6 +47,8 @@
* DISCONNECT_REQ from SAP 1.1 spec 5.1.3
*
* @param serial Id to match req-resp. Resp must include same serial.
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void disconnectReq(in int serial);
@@ -51,6 +57,8 @@
*
* @param serial Id to match req-resp. Resp must include same serial.
* @param powerOn true for on, false for off
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void powerReq(in int serial, in boolean powerOn);
@@ -58,6 +66,8 @@
* RESET_SIM_REQ from SAP 1.1 spec 5.1.14
*
* @param serial Id to match req-resp. Resp must include same serial.
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void resetSimReq(in int serial);
@@ -65,6 +75,8 @@
* Set callback that has response and unsolicited indication functions
*
* @param sapCallback Object containing response and unosolicited indication callbacks
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void setCallback(in ISapCallback sapCallback);
@@ -73,6 +85,8 @@
*
* @param serial Id to match req-resp. Resp must include same serial.
* @param transferProtocol Transport Protocol
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void setTransferProtocolReq(in int serial, in SapTransferProtocol transferProtocol);
@@ -80,6 +94,8 @@
* TRANSFER_ATR_REQ from SAP 1.1 spec 5.1.8
*
* @param serial Id to match req-resp. Resp must include same serial.
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void transferAtrReq(in int serial);
@@ -87,6 +103,8 @@
* TRANSFER_CARD_READER_STATUS_REQ from SAP 1.1 spec 5.1.17
*
* @param serial Id to match req-resp. Resp must include same serial.
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void transferCardReaderStatusReq(in int serial);
}
diff --git a/radio/aidl/android/hardware/radio/sap/ISapCallback.aidl b/radio/aidl/android/hardware/radio/sap/ISapCallback.aidl
index 34111eb..37a94b8 100644
--- a/radio/aidl/android/hardware/radio/sap/ISapCallback.aidl
+++ b/radio/aidl/android/hardware/radio/sap/ISapCallback.aidl
@@ -29,6 +29,8 @@
* @param serial Id to match req-resp. Value must match the one in req.
* @param resultCode ResultCode to indicate if command was processed correctly
* Possible values:
+ * SapResultCode:NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* SapResultCode:SUCCESS,
* SapResultCode:GENERIC_FAILURE,
* SapResultCode:CARD_NOT_ACCESSSIBLE,
@@ -77,6 +79,8 @@
* @param serial Id to match req-resp. Value must match the one in req.
* @param resultCode ResultCode to indicate if command was processed correctly
* Possible values:
+ * SapResultCode:NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* SapResultCode:SUCCESS,
* SapResultCode:GENERIC_FAILURE,
* SapResultCode:CARD_NOT_ACCESSSIBLE, (possible only for power on req)
@@ -92,6 +96,8 @@
* @param serial Id to match req-resp. Value must match the one in req.
* @param resultCode ResultCode to indicate if command was processed correctly
* Possible values:
+ * SapResultCode:NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* SapResultCode:SUCCESS,
* SapResultCode:GENERIC_FAILURE,
* SapResultCode:CARD_NOT_ACCESSSIBLE,
@@ -114,6 +120,8 @@
* @param serial Id to match req-resp. Value must match the one in req.
* @param resultCode ResultCode to indicate if command was processed correctly
* Possible values:
+ * SapResultCode:NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* SapResultCode:SUCCESS,
* SapResultCode:GENERIC_FAILURE,
* SapResultCode:CARD_ALREADY_POWERED_OFF,
@@ -130,6 +138,8 @@
* @param serial Id to match req-resp. Value must match the one in req.
* @param resultCode ResultCode to indicate if command was processed correctly
* Possible values:
+ * SapResultCode:NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* SapResultCode:SUCCESS,
* SapResultCode:GENERIC_FAILURE
* SapResultCode:DATA_NOT_AVAILABLE
@@ -145,6 +155,8 @@
* @param serial Id to match req-resp. Value must match the one in req.
* @param resultCode ResultCode to indicate if command was processed correctly
* Possible values:
+ * SapResultCode:NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* SapResultCode:SUCCESS
* SapResultCode:NOT_SUPPORTED
*/
diff --git a/radio/aidl/android/hardware/radio/sim/IRadioSim.aidl b/radio/aidl/android/hardware/radio/sim/IRadioSim.aidl
index 1453664..7870a74 100644
--- a/radio/aidl/android/hardware/radio/sim/IRadioSim.aidl
+++ b/radio/aidl/android/hardware/radio/sim/IRadioSim.aidl
@@ -49,6 +49,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioSimResponse.areUiccApplicationsEnabledResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void areUiccApplicationsEnabled(in int serial);
@@ -61,6 +63,8 @@
* @param aid AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value.
*
* Response function is IRadioSimResponse.changeIccPin2ForAppResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void changeIccPin2ForApp(in int serial, in String oldPin2, in String newPin2, in String aid);
@@ -73,6 +77,8 @@
* @param aid AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value.
*
* Response function is IRadioSimResponse.changeIccPinForAppResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void changeIccPinForApp(in int serial, in String oldPin, in String newPin, in String aid);
@@ -91,6 +97,8 @@
* @param enable true if to enable uiccApplications, false to disable.
*
* Response function is IRadioSimResponse.enableUiccApplicationsResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void enableUiccApplications(in int serial, in boolean enable);
@@ -100,6 +108,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioSimResponse.getAllowedCarriersResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void getAllowedCarriers(in int serial);
@@ -111,6 +121,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioSimResponse.getCdmaSubscriptionResponse()
+ *
+ * This is available when android.hardware.telephony.cdma is defined.
*/
void getCdmaSubscription(in int serial);
@@ -120,6 +132,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioSimResponse.getCdmaSubscriptionSourceResponse()
+ *
+ * This is available when android.hardware.telephony.cdma is defined.
*/
void getCdmaSubscriptionSource(in int serial);
@@ -135,6 +149,8 @@
* This is only applicable in the case of Fixed Dialing Numbers (FDN) requests.
*
* Response function is IRadioSimResponse.getFacilityLockForAppResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void getFacilityLockForApp(in int serial, in String facility, in String password,
in int serviceClass, in String appId);
@@ -145,6 +161,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioSimResponse.getIccCardStatusResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void getIccCardStatus(in int serial);
@@ -155,6 +173,8 @@
* @param aid AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value.
*
* Response function is IRadioSimResponse.getImsiForAppResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void getImsiForApp(in int serial, in String aid);
@@ -164,6 +184,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioSimResponse.getSimPhonebookCapacityResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void getSimPhonebookCapacity(in int serial);
@@ -175,6 +197,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioSimResponse.getSimPhonebookRecordsResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void getSimPhonebookRecords(in int serial);
@@ -187,6 +211,8 @@
*
* Response function is IRadioSimResponse.iccCloseLogicalChannelResponse()
*
+ * This is available when android.hardware.telephony.subscription is defined.
+ *
* @deprecated use iccCloseLogicalChannelWithSessionInfo instead.
*/
void iccCloseLogicalChannel(in int serial, in int channelId);
@@ -202,6 +228,8 @@
* @param iccIo IccIo
*
* Response function is IRadioSimResponse.iccIoForAppResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void iccIoForApp(in int serial, in IccIo iccIo);
@@ -220,6 +248,8 @@
* @param p2 P2 value, described in ISO 7816-4. Ignore if equal to RadioConst:P2_CONSTANT_NO_P2
*
* Response function is IRadioSimResponse.iccOpenLogicalChannelResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void iccOpenLogicalChannel(in int serial, in String aid, in int p2);
@@ -233,6 +263,8 @@
* @param message SimApdu to be sent
*
* Response function is IRadioSimResponse.iccTransmitApduBasicChannelResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void iccTransmitApduBasicChannel(in int serial, in SimApdu message);
@@ -245,6 +277,8 @@
* @param message SimApdu to be sent
*
* Response function is IRadioSimResponse.iccTransmitApduLogicalChannelResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void iccTransmitApduLogicalChannel(in int serial, in SimApdu message);
@@ -254,6 +288,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioSimResponse.reportStkServiceIsRunningResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void reportStkServiceIsRunning(in int serial);
@@ -267,6 +303,8 @@
* @param aid AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value
*
* Response function is IRadioSimResponse.requestIccSimAuthenticationResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void requestIccSimAuthentication(
in int serial, in int authContext, in String authData, in String aid);
@@ -275,6 +313,8 @@
* When response type received from a radio indication or radio response is
* RadioIndicationType:UNSOLICITED_ACK_EXP or RadioResponseType:SOLICITED_ACK_EXP respectively,
* acknowledge the receipt of those messages by sending responseAcknowledgement().
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void responseAcknowledgement();
@@ -286,6 +326,8 @@
* @param contents SAT/USAT command in hexadecimal format string starting with command tag
*
* Response function is IRadioSimResponse.sendEnvelopeResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void sendEnvelope(in int serial, in String contents);
@@ -301,6 +343,8 @@
* @param contents SAT/USAT command in hexadecimal format starting with command tag
*
* Response function is IRadioSimResponse.sendEnvelopeWithStatusResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void sendEnvelopeWithStatus(in int serial, in String contents);
@@ -312,6 +356,8 @@
* first byte of response data
*
* Response function is IRadioSimResponse.sendTerminalResponseResponseToSim()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void sendTerminalResponseToSim(in int serial, in String contents);
@@ -331,6 +377,8 @@
* @param multiSimPolicy Policy to be used for devices with multiple SIMs.
*
* Response function is IRadioSimResponse.setAllowedCarriersResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void setAllowedCarriers(in int serial, in CarrierRestrictions carriers,
in SimLockMultiSimPolicy multiSimPolicy);
@@ -344,6 +392,8 @@
* @param imsiEncryptionInfo ImsiEncryptionInfo
*
* Response function is IRadioSimResponse.setCarrierInfoForImsiEncryptionResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void setCarrierInfoForImsiEncryption(in int serial, in ImsiEncryptionInfo imsiEncryptionInfo);
@@ -354,6 +404,8 @@
* @param cdmaSub CdmaSubscriptionSource
*
* Response function is IRadioSimResponse.setCdmaSubscriptionSourceResponse()
+ *
+ * This is available when android.hardware.telephony.cdma is defined.
*/
void setCdmaSubscriptionSource(in int serial, in CdmaSubscriptionSource cdmaSub);
@@ -370,6 +422,8 @@
* This is only applicable in the case of Fixed Dialing Numbers (FDN) requests.
*
* Response function is IRadioSimResponse.setFacilityLockForAppResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void setFacilityLockForApp(in int serial, in String facility, in boolean lockState,
in String password, in int serviceClass, in String appId);
@@ -379,6 +433,8 @@
*
* @param radioSimResponse Object containing response functions
* @param radioSimIndication Object containing radio indications
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void setResponseFunctions(
in IRadioSimResponse radioSimResponse, in IRadioSimIndication radioSimIndication);
@@ -409,6 +465,8 @@
* POWER_UP_PASS_THROUGH if powering up the SIM card in pass through mode
*
* Response function is IRadioSimResponse.setSimCardPowerResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void setSimCardPower(in int serial, in CardPowerState powerUp);
@@ -419,6 +477,8 @@
* @param uiccSub SelectUiccSub
*
* Response function is IRadioSimResponse.setUiccSubscriptionResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void setUiccSubscription(in int serial, in SelectUiccSub uiccSub);
@@ -431,6 +491,8 @@
* @param aid AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value.
*
* Response function is IRadioSimResponse.supplyIccPin2ForAppResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void supplyIccPin2ForApp(in int serial, in String pin2, in String aid);
@@ -442,6 +504,8 @@
* @param aid AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value.
*
* Response function is IRadioSimResponse.supplyIccPinForAppResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void supplyIccPinForApp(in int serial, in String pin, in String aid);
@@ -454,6 +518,8 @@
* @param aid AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value.
*
* Response function is IRadioSimResponse.supplyIccPuk2ForAppResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void supplyIccPuk2ForApp(in int serial, in String puk2, in String pin2, in String aid);
@@ -466,6 +532,8 @@
* @param aid AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value.
*
* Response function is IRadioSimResponse.supplyIccPukForAppResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void supplyIccPukForApp(in int serial, in String puk, in String pin, in String aid);
@@ -481,6 +549,8 @@
* @param controlKey the unlock code for removing persoType personalization from this device
*
* Response function is IRadioSimResponse.supplySimDepersonalizationResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void supplySimDepersonalization(
in int serial, in PersoSubstate persoType, in String controlKey);
@@ -496,6 +566,8 @@
* @param recordInfo Details of the record to insert, delete or update.
*
* Response function is IRadioSimResponse.updateSimPhonebookRecordsResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void updateSimPhonebookRecords(in int serial, in PhonebookRecordInfo recordInfo);
@@ -511,6 +583,8 @@
* @param sessionInfo Details of the opened logical channel info like sessionId and isEs10.
*
* Response function is IRadioSimResponse.iccCloseLogicalChannelWithSessionInfoResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void iccCloseLogicalChannelWithSessionInfo(in int serial, in SessionInfo sessionInfo);
}
diff --git a/radio/aidl/android/hardware/radio/sim/IRadioSimResponse.aidl b/radio/aidl/android/hardware/radio/sim/IRadioSimResponse.aidl
index 48253d4..91b5729 100644
--- a/radio/aidl/android/hardware/radio/sim/IRadioSimResponse.aidl
+++ b/radio/aidl/android/hardware/radio/sim/IRadioSimResponse.aidl
@@ -45,6 +45,8 @@
* @param enabled whether Uicc applications are enabled.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:SIM_ABSENT
* RadioError:RADIO_NOT_AVAILABLE
@@ -57,6 +59,8 @@
* @param remainingRetries Number of retries remaining, must be equal to -1 if unknown.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:PASSWORD_INCORRECT (old PIN2 is invalid)
@@ -75,6 +79,8 @@
* @param remainingRetries Number of retries remaining, must be equal to -1 if unknown.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:PASSWORD_INCORRECT
@@ -91,6 +97,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:SIM_ABSENT
* RadioError:RADIO_NOT_AVAILABLE
@@ -105,6 +113,8 @@
* @param multiSimPolicy Policy used for devices with multiple SIM cards.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
*/
@@ -122,6 +132,7 @@
* @param prl PRL version if CDMA subscription is available
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.cdma is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SUBSCRIPTION_NOT_AVAILABLE
@@ -143,6 +154,7 @@
* @param source CDMA subscription source
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.cdma is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SUBSCRIPTION_NOT_AVAILABLE
@@ -161,6 +173,8 @@
* specified barring facility is active. "0" means "disabled for all"
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SS_MODIFIED_TO_DIAL
@@ -182,6 +196,8 @@
* @param cardStatus ICC card status as defined by CardStatus
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -194,6 +210,8 @@
* @param imsi String containing the IMSI
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:INTERNAL_ERR
@@ -210,6 +228,8 @@
* @param capacity Response capacity enum indicating response processing status
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -223,6 +243,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -236,6 +258,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -252,6 +276,8 @@
* @param iccIo ICC IO operation response
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SIM_PIN2
@@ -272,6 +298,8 @@
* byte per integer
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:MISSING_RESOURCE
@@ -292,6 +320,8 @@
* @param result IccIoResult
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -306,6 +336,8 @@
* @param result IccIoResult
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -319,6 +351,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -333,6 +367,8 @@
* @param result IccIoResult
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -351,6 +387,8 @@
* byte of response
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SIM_BUSY
@@ -370,6 +408,8 @@
* @param iccIo IccIoResult corresponding to ICC IO response
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SIM_BUSY
@@ -386,6 +426,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -403,6 +445,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -413,6 +457,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SIM_ABSENT
@@ -425,6 +471,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.cdma is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SIM_ABSENT
@@ -441,6 +488,8 @@
* @param retry 0 is the number of retries remaining, or -1 if unknown
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SS_MODIFIED_TO_DIAL
@@ -463,6 +512,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -474,6 +525,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SUBSCRIPTION_NOT_SUPPORTED
@@ -492,6 +545,8 @@
* @param remainingRetries Number of retries remaining, must be equal to -1 if unknown.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:PASSWORD_INCORRECT
@@ -510,6 +565,8 @@
* @param remainingRetries Number of retries remaining, must be equal to -1 if unknown.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:PASSWORD_INCORRECT
@@ -527,6 +584,8 @@
* @param remainingRetries Number of retries remaining, must be equal to -1 if unknown.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:PASSWORD_INCORRECT (PUK is invalid)
@@ -544,6 +603,8 @@
* @param remainingRetries Number of retries remaining, must be equal to -1 if unknown.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:PASSWORD_INCORRECT (PUK is invalid)
@@ -563,6 +624,8 @@
* to -1 if number of retries is infinite.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:PASSWORD_INCORRECT (code is invalid)
@@ -583,6 +646,8 @@
* the minimum value is 1
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -599,6 +664,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
diff --git a/radio/aidl/android/hardware/radio/voice/IRadioVoice.aidl b/radio/aidl/android/hardware/radio/voice/IRadioVoice.aidl
index bf9b9cb..0c2b51d 100644
--- a/radio/aidl/android/hardware/radio/voice/IRadioVoice.aidl
+++ b/radio/aidl/android/hardware/radio/voice/IRadioVoice.aidl
@@ -41,6 +41,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.acceptCallResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void acceptCall(in int serial);
@@ -50,6 +52,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.cancelPendingUssdResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void cancelPendingUssd(in int serial);
@@ -59,6 +63,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.conferenceResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void conference(in int serial);
@@ -69,6 +75,8 @@
* @param dialInfo Dial struct
*
* Response function is IRadioVoiceResponse.dialResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void dial(in int serial, in Dial dialInfo);
@@ -125,6 +133,8 @@
* @param isTesting Flag indicating if this request is for testing purpose.
*
* Response function is IRadioVoiceResponse.emergencyDialResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void emergencyDial(in int serial, in Dial dialInfo, in int categories, in String[] urns,
in EmergencyCallRouting routing, in boolean hasKnownUserIntentEmergency,
@@ -137,6 +147,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.exitEmergencyCallbackModeResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void exitEmergencyCallbackMode(in int serial);
@@ -146,6 +158,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.explicitCallTransferResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void explicitCallTransfer(in int serial);
@@ -156,6 +170,8 @@
* @param callInfo CallForwardInfo
*
* Response function is IRadioVoiceResponse.getCallForwardStatusResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void getCallForwardStatus(in int serial, in CallForwardInfo callInfo);
@@ -166,6 +182,8 @@
* @param serviceClass Service class is the TS 27.007 service class to query
*
* Response function is IRadioVoiceResponse.getCallWaitingResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void getCallWaiting(in int serial, in int serviceClass);
@@ -175,6 +193,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.getClipResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void getClip(in int serial);
@@ -184,6 +204,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.getClirResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void getClir(in int serial);
@@ -193,6 +215,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.getCurrentCallsResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void getCurrentCalls(in int serial);
@@ -202,6 +226,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.getLastCallFailCauseResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void getLastCallFailCause(in int serial);
@@ -211,6 +237,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.getMuteResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void getMute(in int serial);
@@ -220,6 +248,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.getPreferredVoicePrivacyResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void getPreferredVoicePrivacy(in int serial);
@@ -229,6 +259,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.getTtyModeResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void getTtyMode(in int serial);
@@ -241,6 +273,8 @@
* @param accept true = accept the call setup, false = reject the call setup
*
* Response function is IRadioVoiceResponse.handleStkCallSetupRequestFromSimResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void handleStkCallSetupRequestFromSim(in int serial, in boolean accept);
@@ -252,6 +286,8 @@
* @param gsmIndex Connection index (value of 'x' in CHLD above)
*
* Response function is IRadioVoiceResponse.hangupResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void hangup(in int serial, in int gsmIndex);
@@ -262,6 +298,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.hangupForegroundResumeBackgroundResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void hangupForegroundResumeBackground(in int serial);
@@ -272,6 +310,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.hangupWaitingOrBackgroundResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void hangupWaitingOrBackground(in int serial);
@@ -281,6 +321,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.isVoNrEnabledResponse()
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void isVoNrEnabled(in int serial);
@@ -290,6 +332,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.rejectCallResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void rejectCall(in int serial);
@@ -297,6 +341,8 @@
* When response type received from a radio indication or radio response is
* RadioIndicationType:UNSOLICITED_ACK_EXP or RadioResponseType:SOLICITED_ACK_EXP respectively,
* acknowledge the receipt of those messages by sending responseAcknowledgement().
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void responseAcknowledgement();
@@ -309,6 +355,8 @@
* @param off is the DTMF OFF length in milliseconds, or 0 to use default
*
* Response function is IRadioVoiceResponse.sendBurstDtmfResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void sendBurstDtmf(in int serial, in String dtmf, in int on, in int off);
@@ -319,6 +367,8 @@
* @param featureCode String associated with Flash command
*
* Response function is IRadioVoiceResponse.sendCdmaFeatureCodeResponse()
+ *
+ * This is available when android.hardware.telephony.cdma is defined.
*/
void sendCdmaFeatureCode(in int serial, in String featureCode);
@@ -330,6 +380,8 @@
* @param s string with single char having one of 12 values: 0-9, *, #
*
* Response function is IRadioVoiceResponse.sendDtmfResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void sendDtmf(in int serial, in String s);
@@ -347,6 +399,8 @@
* @param ussd string containing the USSD request in UTF-8 format
*
* Response function is IRadioVoiceResponse.sendUssdResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void sendUssd(in int serial, in String ussd);
@@ -363,6 +417,8 @@
* @param gsmIndex contains Connection index (value of 'x' in CHLD above)
*
* Response function is IRadioVoiceResponse.separateConnectionResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void separateConnection(in int serial, in int gsmIndex);
@@ -373,6 +429,8 @@
* @param callInfo CallForwardInfo
*
* Response function is IRadioVoiceResponse.setCallForwardResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void setCallForward(in int serial, in CallForwardInfo callInfo);
@@ -384,6 +442,8 @@
* @param serviceClass is the TS 27.007 service class bit vector of services to modify
*
* Response function is IRadioVoiceResponse.setCallWaitingResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void setCallWaiting(in int serial, in boolean enable, in int serviceClass);
@@ -394,6 +454,8 @@
* @param status "n" parameter from TS 27.007 7.7
*
* Response function is IRadioVoiceResponse.setClirResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void setClir(in int serial, in int status);
@@ -405,6 +467,8 @@
* @param enable true for "enable mute" and false for "disable mute"
*
* Response function is IRadioVoiceResponse.setMuteResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void setMute(in int serial, in boolean enable);
@@ -416,6 +480,8 @@
* true for Enhanced Privacy Mode (Private Long Code Mask)
*
* Response function is IRadioVoiceResponse.setPreferredVoicePrivacyResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void setPreferredVoicePrivacy(in int serial, in boolean enable);
@@ -424,6 +490,8 @@
*
* @param radioVoiceResponse Object containing response functions
* @param radioVoiceIndication Object containing radio indications
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void setResponseFunctions(in IRadioVoiceResponse radioVoiceResponse,
in IRadioVoiceIndication radioVoiceIndication);
@@ -435,6 +503,8 @@
* @param mode TtyMode
*
* Response function is IRadioVoiceResponse.setTtyModeResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void setTtyMode(in int serial, in TtyMode mode);
@@ -445,6 +515,8 @@
* @param enable true for "enable vonr" and false for "disable vonr"
*
* Response function is IRadioVoiceResponse.setVoNrEnabledResponse()
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void setVoNrEnabled(in int serial, in boolean enable);
@@ -457,6 +529,8 @@
* @param s string having a single character with one of 12 values: 0-9,*,#
*
* Response function is IRadioVoiceResponse.startDtmfResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void startDtmf(in int serial, in String s);
@@ -466,6 +540,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.stopDtmfResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void stopDtmf(in int serial);
@@ -483,6 +559,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.switchWaitingOrHoldingAndActiveResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void switchWaitingOrHoldingAndActive(in int serial);
}
diff --git a/radio/aidl/android/hardware/radio/voice/IRadioVoiceResponse.aidl b/radio/aidl/android/hardware/radio/voice/IRadioVoiceResponse.aidl
index 21264df..a904eaa 100644
--- a/radio/aidl/android/hardware/radio/voice/IRadioVoiceResponse.aidl
+++ b/radio/aidl/android/hardware/radio/voice/IRadioVoiceResponse.aidl
@@ -33,6 +33,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_STATE
@@ -61,6 +62,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SIM_BUSY
@@ -81,6 +83,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:NO_MEMORY
@@ -101,6 +104,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:DIAL_MODIFIED_TO_USSD
@@ -129,6 +133,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:DIAL_MODIFIED_TO_USSD
@@ -152,6 +157,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:OPERATION_NO_ALLOWED
@@ -170,6 +176,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -196,6 +203,7 @@
* CallForwardInfo must be returned with the service class set to "data + voice = 3".
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SS_MODIFIED_TO_DIAL
@@ -223,6 +231,7 @@
* for data and voice and disabled for everything else.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SS_MODIFIED_TO_DIAL
@@ -245,6 +254,7 @@
* @param status indicates CLIP status
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -264,6 +274,7 @@
* @param m is "m" parameter from TS 27.007 7.7
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SS_MODIFIED_TO_DIAL
@@ -285,6 +296,7 @@
* @param calls Current call list
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NO_MEMORY
* RadioError:INTERNAL_ERR
* RadioError:SYSTEM_ERR
@@ -327,6 +339,7 @@
* for tone generation or error notification.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:NO_MEMORY
* RadioError:RADIO_NOT_AVAILABLE
@@ -346,6 +359,7 @@
* @param enable true for "mute enabled" and false for "mute disabled"
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SS_MODIFIED_TO_DIAL
@@ -367,6 +381,7 @@
* true for Enhanced Privacy Mode (Private Long Code Mask)
*
* Valid errors:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -384,6 +399,7 @@
* @param mode TtyMode
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -400,6 +416,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:NO_MEMORY
@@ -417,6 +434,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:INVALID_ARGUMENTS
@@ -434,6 +452,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:INVALID_STATE
@@ -454,6 +473,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:INVALID_STATE
@@ -474,6 +494,7 @@
* @param enable true for "vonr enabled" and false for "vonr disabled"
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.ims is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:MODEM_ERR
@@ -486,6 +507,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:INVALID_STATE
@@ -507,6 +529,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -527,6 +550,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.cdma is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -547,6 +571,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -565,6 +590,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:FDN_CHECK_FAILURE
@@ -590,6 +616,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -610,6 +637,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SS_MODIFIED_TO_DIAL
@@ -632,6 +660,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SS_MODIFIED_TO_DIAL
@@ -654,6 +683,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE
@@ -672,6 +702,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -688,6 +719,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -705,6 +737,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -721,6 +754,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -734,6 +768,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -753,6 +788,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -772,6 +808,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:INVALID_STATE
diff --git a/radio/aidl/compat/libradiocompat/ims/media/RadioImsMediaSession.cpp b/radio/aidl/compat/libradiocompat/ims/media/RadioImsMediaSession.cpp
index ae86914..d509300 100644
--- a/radio/aidl/compat/libradiocompat/ims/media/RadioImsMediaSession.cpp
+++ b/radio/aidl/compat/libradiocompat/ims/media/RadioImsMediaSession.cpp
@@ -60,5 +60,12 @@
LOG(ERROR) << " setMediaQualityThreshold is unsupported by HIDL HALs";
return ok();
}
-
+ScopedAStatus RadioImsMediaSession::requestRtpReceptionStats(int32_t /*in_intervalMs*/) {
+ LOG(ERROR) << " requestRtpReceptionStats is unsupported by HIDL HALs";
+ return ok();
+}
+ScopedAStatus RadioImsMediaSession::adjustDelay(int32_t /*in_delayMs*/) {
+ LOG(ERROR) << " adjustDelay is unsupported by HIDL HALs";
+ return ok();
+}
} // namespace android::hardware::radio::compat
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioImsMediaSession.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioImsMediaSession.h
index 00f21fc..715fc77 100644
--- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioImsMediaSession.h
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioImsMediaSession.h
@@ -38,6 +38,8 @@
::ndk::ScopedAStatus setMediaQualityThreshold(
const ::aidl::android::hardware::radio::ims::media::MediaQualityThreshold& in_threshold)
override;
+ ::ndk::ScopedAStatus requestRtpReceptionStats(int32_t in_intervalMs) override;
+ ::ndk::ScopedAStatus adjustDelay(int32_t in_delayMs) override;
protected:
public:
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h
index 312b615..56724ae 100644
--- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h
@@ -111,6 +111,9 @@
::ndk::ScopedAStatus setCellularIdentifierTransparencyEnabled(int32_t serial,
bool enabled) override;
+ ::ndk::ScopedAStatus setSecurityAlgorithmsUpdatedEnabled(int32_t serial, bool enabled) override;
+ ::ndk::ScopedAStatus isSecurityAlgorithmsUpdatedEnabled(int32_t serial) override;
+
protected:
std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkResponse> respond();
diff --git a/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp b/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp
index f5a1838..1e43789 100644
--- a/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp
+++ b/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp
@@ -387,4 +387,19 @@
respond()->setCellularIdentifierTransparencyEnabledResponse(notSupported(serial));
return ok();
}
+
+ScopedAStatus RadioNetwork::isSecurityAlgorithmsUpdatedEnabled(int32_t serial) {
+ LOG_CALL << serial;
+ LOG(ERROR) << " isSecurityAlgorithmsUpdatedEnabled is unsupported by HIDL HALs";
+ respond()->isSecurityAlgorithmsUpdatedEnabledResponse(notSupported(serial), false);
+ return ok();
+}
+
+ScopedAStatus RadioNetwork::setSecurityAlgorithmsUpdatedEnabled(int32_t serial, bool /*enable*/) {
+ LOG_CALL << serial;
+ LOG(ERROR) << " setSecurityAlgorithmsUpdatedEnabled is unsupported by HIDL HALs";
+ respond()->setSecurityAlgorithmsUpdatedEnabledResponse(notSupported(serial));
+ return ok();
+}
+
} // namespace android::hardware::radio::compat
diff --git a/radio/aidl/vts/Android.bp b/radio/aidl/vts/Android.bp
index ddb1b33..d985686 100644
--- a/radio/aidl/vts/Android.bp
+++ b/radio/aidl/vts/Android.bp
@@ -66,9 +66,13 @@
"radio_voice_test.cpp",
"VtsHalRadioTargetTest.cpp",
],
+ header_libs: [
+ "jni_headers",
+ ],
shared_libs: [
"libbinder_ndk",
"libvintf",
+ "server_configurable_flags",
],
static_libs: [
"android.hardware.radio-V3-ndk",
@@ -82,6 +86,7 @@
"android.hardware.radio.sap-V1-ndk",
"android.hardware.radio.sim-V3-ndk",
"android.hardware.radio.voice-V3-ndk",
+ "telephony_flags_c_lib",
],
test_suites: [
"general-tests",
diff --git a/radio/aidl/vts/radio_aidl_hal_utils.h b/radio/aidl/vts/radio_aidl_hal_utils.h
index d8aa024..aea5cee 100644
--- a/radio/aidl/vts/radio_aidl_hal_utils.h
+++ b/radio/aidl/vts/radio_aidl_hal_utils.h
@@ -24,6 +24,7 @@
#include <aidl/android/hardware/radio/network/RegState.h>
#include <aidl/android/hardware/radio/sim/CardStatus.h>
#include <aidl/android/hardware/radio/sim/IRadioSim.h>
+#include <com_android_internal_telephony_flags.h>
#include <utils/Log.h>
using namespace aidl::android::hardware::radio;
@@ -31,6 +32,8 @@
using aidl::android::hardware::radio::network::RegState;
using aidl::android::hardware::radio::sim::CardStatus;
+namespace telephony_flags = com::android::internal::telephony::flags;
+
extern CardStatus cardStatus;
extern SimSlotStatus slotStatus;
extern int serial;
@@ -68,6 +71,18 @@
static constexpr const char* FEATURE_TELEPHONY_IMS = "android.hardware.telephony.ims";
+static constexpr const char* FEATURE_TELEPHONY_CALLING = "android.hardware.telephony.calling";
+
+static constexpr const char* FEATURE_TELEPHONY_DATA = "android.hardware.telephony.data";
+
+static constexpr const char* FEATURE_TELEPHONY_MESSAGING = "android.hardware.telephony.messaging";
+
+static constexpr const char* FEATURE_TELEPHONY_SUBSCRIPTION =
+ "android.hardware.telephony.subscription";
+
+static constexpr const char* FEATURE_TELEPHONY_RADIO_ACCESS =
+ "android.hardware.telephony.radio.access";
+
#define MODEM_EMERGENCY_CALL_ESTABLISH_TIME 3
#define MODEM_EMERGENCY_CALL_DISCONNECT_TIME 3
#define MODEM_SET_SIM_POWER_DELAY_IN_SECONDS 2
diff --git a/radio/aidl/vts/radio_config_test.cpp b/radio/aidl/vts/radio_config_test.cpp
index aed3b05..d8c0142 100644
--- a/radio/aidl/vts/radio_config_test.cpp
+++ b/radio/aidl/vts/radio_config_test.cpp
@@ -54,6 +54,13 @@
* Test IRadioConfig.getHalDeviceCapabilities() for the response returned.
*/
TEST_P(RadioConfigTest, getHalDeviceCapabilities) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY)) {
+ GTEST_SKIP() << "Skipping getHalDeviceCapabilities "
+ "due to undefined FEATURE_TELEPHONY";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_config->getHalDeviceCapabilities(serial);
ASSERT_OK(res);
@@ -66,6 +73,13 @@
* Test IRadioConfig.getSimSlotsStatus() for the response returned.
*/
TEST_P(RadioConfigTest, getSimSlotsStatus) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping getSimSlotsStatus "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_config->getSimSlotsStatus(serial);
ASSERT_OK(res);
@@ -78,6 +92,13 @@
* Test IRadioConfig.getPhoneCapability() for the response returned.
*/
TEST_P(RadioConfigTest, getPhoneCapability) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY)) {
+ GTEST_SKIP() << "Skipping getPhoneCapability "
+ "due to undefined FEATURE_TELEPHONY";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_config->getPhoneCapability(serial);
ASSERT_OK(res);
@@ -104,6 +125,13 @@
* Test IRadioConfig.setPreferredDataModem() for the response returned.
*/
TEST_P(RadioConfigTest, setPreferredDataModem) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_DATA)) {
+ GTEST_SKIP() << "Skipping setPreferredDataModem "
+ "due to undefined FEATURE_TELEPHONY_DATA";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_config->getPhoneCapability(serial);
ASSERT_OK(res);
@@ -146,6 +174,13 @@
* Test IRadioConfig.setPreferredDataModem() with invalid arguments.
*/
TEST_P(RadioConfigTest, setPreferredDataModem_invalidArgument) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_DATA)) {
+ GTEST_SKIP() << "Skipping setPreferredDataModem_invalidArgument "
+ "due to undefined FEATURE_TELEPHONY_DATA";
+ }
+ }
+
serial = GetRandomSerialNumber();
uint8_t modemId = -1;
ndk::ScopedAStatus res = radio_config->setPreferredDataModem(serial, modemId);
@@ -166,6 +201,13 @@
* Test IRadioConfig.setSimSlotsMapping() for the response returned.
*/
TEST_P(RadioConfigTest, setSimSlotsMapping) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping setSimSlotsMapping "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
// get slot status and set SIM slots mapping based on the result.
updateSimSlotStatus();
if (radioRsp_config->rspInfo.error == RadioError::NONE) {
@@ -227,6 +269,13 @@
*/
TEST_P(RadioConfigTest, checkPortInfoExistsAndPortActive) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping checkPortInfoExistsAndPortActive "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_config->getSimSlotsStatus(serial);
ASSERT_OK(res);
diff --git a/radio/aidl/vts/radio_data_test.cpp b/radio/aidl/vts/radio_data_test.cpp
index f31c254..2aa5508 100644
--- a/radio/aidl/vts/radio_data_test.cpp
+++ b/radio/aidl/vts/radio_data_test.cpp
@@ -68,6 +68,12 @@
* Test IRadioData.setupDataCall() for the response returned.
*/
TEST_P(RadioDataTest, setupDataCall) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_DATA)) {
+ GTEST_SKIP() << "setupDataCall : required FEATURE_TELEPHONY_DATA";
+ }
+ }
+
serial = GetRandomSerialNumber();
AccessNetwork accessNetwork = AccessNetwork::EUTRAN;
@@ -135,6 +141,13 @@
* Test IRadioData.setupDataCall() with osAppId for the response returned.
*/
TEST_P(RadioDataTest, setupDataCall_osAppId) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_DATA)) {
+ GTEST_SKIP() << "Skipping setupDataCall_osAppId "
+ "due to undefined FEATURE_TELEPHONY_DATA";
+ }
+ }
+
serial = GetRandomSerialNumber();
AccessNetwork accessNetwork = AccessNetwork::EUTRAN;
@@ -227,6 +240,13 @@
* Test IRadioData.getSlicingConfig() for the response returned.
*/
TEST_P(RadioDataTest, getSlicingConfig) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_DATA)) {
+ GTEST_SKIP() << "Skipping getSlicingConfig "
+ "due to undefined FEATURE_TELEPHONY_DATA";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_data->getSlicingConfig(serial);
EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -242,6 +262,13 @@
* Test IRadioData.setDataThrottling() for the response returned.
*/
TEST_P(RadioDataTest, setDataThrottling) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_DATA)) {
+ GTEST_SKIP() << "Skipping setDataThrottling "
+ "due to undefined FEATURE_TELEPHONY_DATA";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_data->setDataThrottling(
@@ -320,6 +347,13 @@
* Test IRadioData.setInitialAttachApn() for the response returned.
*/
TEST_P(RadioDataTest, setInitialAttachApn) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_DATA)) {
+ GTEST_SKIP() << "Skipping setInitialAttachApn "
+ "due to undefined FEATURE_TELEPHONY_DATA";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Create a dataProfileInfo
@@ -363,6 +397,13 @@
* Test IRadioData.setDataProfile() for the response returned.
*/
TEST_P(RadioDataTest, setDataProfile) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_DATA)) {
+ GTEST_SKIP() << "Skipping setDataProfile "
+ "due to undefined FEATURE_TELEPHONY_DATA";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Create a dataProfileInfo
@@ -409,6 +450,13 @@
* Test IRadioData.deactivateDataCall() for the response returned.
*/
TEST_P(RadioDataTest, deactivateDataCall) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_DATA)) {
+ GTEST_SKIP() << "Skipping deactivateDataCall "
+ "due to undefined FEATURE_TELEPHONY_DATA";
+ }
+ }
+
serial = GetRandomSerialNumber();
int cid = 1;
DataRequestReason reason = DataRequestReason::NORMAL;
@@ -440,6 +488,13 @@
* Test IRadioData.startKeepalive() for the response returned.
*/
TEST_P(RadioDataTest, startKeepalive) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_DATA)) {
+ GTEST_SKIP() << "Skipping startKeepalive "
+ "due to undefined FEATURE_TELEPHONY_DATA";
+ }
+ }
+
std::vector<KeepaliveRequest> requests = {
{
// Invalid IPv4 source address
@@ -538,6 +593,13 @@
* Test IRadioData.stopKeepalive() for the response returned.
*/
TEST_P(RadioDataTest, stopKeepalive) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_DATA)) {
+ GTEST_SKIP() << "Skipping stopKeepalive "
+ "due to undefined FEATURE_TELEPHONY_DATA";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_data->stopKeepalive(serial, 0xBAD);
@@ -554,6 +616,13 @@
* Test IRadioData.getDataCallList() for the response returned.
*/
TEST_P(RadioDataTest, getDataCallList) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_DATA)) {
+ GTEST_SKIP() << "Skipping getDataCallList "
+ "due to undefined FEATURE_TELEPHONY_DATA";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_data->getDataCallList(serial);
@@ -573,6 +642,13 @@
* Test IRadioData.setDataAllowed() for the response returned.
*/
TEST_P(RadioDataTest, setDataAllowed) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_DATA)) {
+ GTEST_SKIP() << "Skipping setDataAllowed "
+ "due to undefined FEATURE_TELEPHONY_DATA";
+ }
+ }
+
serial = GetRandomSerialNumber();
bool allow = true;
diff --git a/radio/aidl/vts/radio_imsmedia_session_listener.cpp b/radio/aidl/vts/radio_imsmedia_session_listener.cpp
index 986cab2..638a0e4 100644
--- a/radio/aidl/vts/radio_imsmedia_session_listener.cpp
+++ b/radio/aidl/vts/radio_imsmedia_session_listener.cpp
@@ -49,3 +49,7 @@
const CallQuality& /*in_callQuality*/) {
return ndk::ScopedAStatus::ok();
}
+ndk::ScopedAStatus ImsMediaSessionListener::notifyRtpReceptionStats(
+ const RtpReceptionStats& /*in_stats*/) {
+ return ndk::ScopedAStatus::ok();
+}
diff --git a/radio/aidl/vts/radio_imsmedia_test.cpp b/radio/aidl/vts/radio_imsmedia_test.cpp
index 425f6b4..e479e64 100644
--- a/radio/aidl/vts/radio_imsmedia_test.cpp
+++ b/radio/aidl/vts/radio_imsmedia_test.cpp
@@ -260,6 +260,59 @@
return result;
}
+TEST_P(RadioImsMediaTest, testAvSyncOperation) {
+ int32_t sessionId = 1;
+ RtpConfig modifyRtpConfig;
+ int32_t receptionInterval = 1000;
+ int32_t delay = 200;
+
+ 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;
+
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_IMS)) {
+ ALOGI("Skipping setListener because ims is not supported in device");
+ return;
+ } else {
+ ALOGI("Running setListener because ims is supported in device");
+ }
+
+ ndk::ScopedAStatus res = radio_imsmedia->setListener(radio_imsmedialistener);
+ ASSERT_OK(res);
+
+ serial = SERIAL_OPEN_SESSION;
+ res = triggerOpenSession(sessionId);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(sessionId, radio_imsmedialistener->mSessionId);
+ ASSERT_NE(nullptr, radio_imsmedialistener->mSession);
+
+ radio_imsmediasession = radio_imsmedialistener->mSession;
+ radio_imsmediasession->setListener(radio_imsmediasessionlistener);
+ ASSERT_OK(res);
+
+ serial = SERIAL_MODIFY_SESSION;
+ res = radio_imsmediasession->modifySession(modifyRtpConfig);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(modifyRtpConfig, radio_imsmediasessionlistener->mConfig);
+ verifyError(radio_imsmediasessionlistener->mError);
+
+ res = radio_imsmediasession->requestRtpReceptionStats(receptionInterval);
+ ASSERT_OK(res);
+
+ res = radio_imsmediasession->adjustDelay(delay);
+ ASSERT_OK(res);
+
+ serial = SERIAL_CLOSE_SESSION;
+ res = radio_imsmedia->closeSession(sessionId);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+}
+
void RadioImsMediaTest::verifyError(RtpError error) {
switch (error) {
case RtpError::NONE:
diff --git a/radio/aidl/vts/radio_imsmedia_utils.h b/radio/aidl/vts/radio_imsmedia_utils.h
index 87f1b00..407ba95 100644
--- a/radio/aidl/vts/radio_imsmedia_utils.h
+++ b/radio/aidl/vts/radio_imsmedia_utils.h
@@ -76,6 +76,7 @@
virtual ndk::ScopedAStatus onDtmfReceived(char16_t in_dtmfDigit,
int32_t in_durationMs) override;
virtual ndk::ScopedAStatus onCallQualityChanged(const CallQuality& in_callQuality) override;
+ virtual ndk::ScopedAStatus notifyRtpReceptionStats(const RtpReceptionStats& in_stats) override;
};
/* The main test class for Radio AIDL ImsMedia. */
diff --git a/radio/aidl/vts/radio_messaging_test.cpp b/radio/aidl/vts/radio_messaging_test.cpp
index 4ab88d2..95e2617 100644
--- a/radio/aidl/vts/radio_messaging_test.cpp
+++ b/radio/aidl/vts/radio_messaging_test.cpp
@@ -59,6 +59,13 @@
* Test IRadioMessaging.sendSms() for the response returned.
*/
TEST_P(RadioMessagingTest, sendSms) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_MESSAGING)) {
+ GTEST_SKIP() << "Skipping sendSms "
+ "due to undefined FEATURE_TELEPHONY_MESSAGING";
+ }
+ }
+
serial = GetRandomSerialNumber();
GsmSmsMessage msg;
msg.smscPdu = "";
@@ -83,6 +90,13 @@
* Test IRadioMessaging.sendSmsExpectMore() for the response returned.
*/
TEST_P(RadioMessagingTest, sendSmsExpectMore) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_MESSAGING)) {
+ GTEST_SKIP() << "Skipping sendSmsExpectMore "
+ "due to undefined FEATURE_TELEPHONY_MESSAGING";
+ }
+ }
+
serial = GetRandomSerialNumber();
GsmSmsMessage msg;
msg.smscPdu = "";
@@ -106,6 +120,13 @@
* Test IRadioMessaging.sendCdmaSms() for the response returned.
*/
TEST_P(RadioMessagingTest, sendCdmaSms) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ GTEST_SKIP() << "Skipping sendCdmaSms "
+ "due to undefined FEATURE_TELEPHONY_CDMA";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Create a CdmaSmsAddress
@@ -150,6 +171,13 @@
* Test IRadioMessaging.sendCdmaSmsExpectMore() for the response returned.
*/
TEST_P(RadioMessagingTest, sendCdmaSmsExpectMore) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ GTEST_SKIP() << "Skipping sendCdmaSmsExpectMore "
+ "due to undefined FEATURE_TELEPHONY_CDMA";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Create a CdmaSmsAddress
@@ -194,6 +222,13 @@
* Test IRadioMessaging.setGsmBroadcastConfig() for the response returned.
*/
TEST_P(RadioMessagingTest, setGsmBroadcastConfig) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_MESSAGING)) {
+ GTEST_SKIP() << "Skipping setGsmBroadcastConfig "
+ "due to undefined FEATURE_TELEPHONY_MESSAGING";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Create GsmBroadcastSmsConfigInfo #1
@@ -257,6 +292,13 @@
* Test IRadioMessaging.getGsmBroadcastConfig() for the response returned.
*/
TEST_P(RadioMessagingTest, getGsmBroadcastConfig) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_MESSAGING)) {
+ GTEST_SKIP() << "Skipping getGsmBroadcastConfig "
+ "due to undefined FEATURE_TELEPHONY_MESSAGING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_messaging->getGsmBroadcastConfig(serial);
@@ -277,6 +319,13 @@
* Test IRadioMessaging.setCdmaBroadcastConfig() for the response returned.
*/
TEST_P(RadioMessagingTest, setCdmaBroadcastConfig) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ GTEST_SKIP() << "Skipping setCdmaBroadcastConfig "
+ "due to undefined FEATURE_TELEPHONY_CDMA";
+ }
+ }
+
serial = GetRandomSerialNumber();
CdmaBroadcastSmsConfigInfo cbSmsConfig;
@@ -303,6 +352,13 @@
* Test IRadioMessaging.getCdmaBroadcastConfig() for the response returned.
*/
TEST_P(RadioMessagingTest, getCdmaBroadcastConfig) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ GTEST_SKIP() << "Skipping getCdmaBroadcastConfig "
+ "due to undefined FEATURE_TELEPHONY_CDMA";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_messaging->getCdmaBroadcastConfig(serial);
@@ -321,6 +377,13 @@
* Test IRadioMessaging.setCdmaBroadcastActivation() for the response returned.
*/
TEST_P(RadioMessagingTest, setCdmaBroadcastActivation) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ GTEST_SKIP() << "Skipping setCdmaBroadcastActivation "
+ "due to undefined FEATURE_TELEPHONY_CDMA";
+ }
+ }
+
serial = GetRandomSerialNumber();
bool activate = false;
@@ -341,6 +404,13 @@
* Test IRadioMessaging.setGsmBroadcastActivation() for the response returned.
*/
TEST_P(RadioMessagingTest, setGsmBroadcastActivation) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_MESSAGING)) {
+ GTEST_SKIP() << "Skipping setGsmBroadcastActivation "
+ "due to undefined FEATURE_TELEPHONY_MESSAGING";
+ }
+ }
+
serial = GetRandomSerialNumber();
bool activate = false;
@@ -363,6 +433,13 @@
* Test IRadioMessaging.acknowledgeLastIncomingGsmSms() for the response returned.
*/
TEST_P(RadioMessagingTest, acknowledgeLastIncomingGsmSms) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_MESSAGING)) {
+ GTEST_SKIP() << "Skipping acknowledgeLastIncomingGsmSms "
+ "due to undefined FEATURE_TELEPHONY_MESSAGING";
+ }
+ }
+
serial = GetRandomSerialNumber();
bool success = true;
@@ -384,6 +461,13 @@
* Test IRadioMessaging.acknowledgeIncomingGsmSmsWithPdu() for the response returned.
*/
TEST_P(RadioMessagingTest, acknowledgeIncomingGsmSmsWithPdu) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_MESSAGING)) {
+ GTEST_SKIP() << "Skipping acknowledgeIncomingGsmSmsWithPdu "
+ "due to undefined FEATURE_TELEPHONY_MESSAGING";
+ }
+ }
+
serial = GetRandomSerialNumber();
bool success = true;
std::string ackPdu = "";
@@ -405,6 +489,13 @@
* Test IRadioMessaging.acknowledgeLastIncomingCdmaSms() for the response returned.
*/
TEST_P(RadioMessagingTest, acknowledgeLastIncomingCdmaSms) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ GTEST_SKIP() << "Skipping acknowledgeIncomingGsmSmsWithPdu "
+ "due to undefined FEATURE_TELEPHONY_CDMA";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Create a CdmaSmsAck
@@ -429,6 +520,13 @@
* Test IRadioMessaging.sendImsSms() for the response returned.
*/
TEST_P(RadioMessagingTest, sendImsSms) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_IMS)) {
+ GTEST_SKIP() << "Skipping acknowledgeIncomingGsmSmsWithPdu "
+ "due to undefined FEATURE_TELEPHONY_IMS";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Create a CdmaSmsAddress
@@ -479,6 +577,13 @@
* Test IRadioMessaging.getSmscAddress() for the response returned.
*/
TEST_P(RadioMessagingTest, getSmscAddress) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_MESSAGING)) {
+ GTEST_SKIP() << "Skipping getSmscAddress "
+ "due to undefined FEATURE_TELEPHONY_MESSAGING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_messaging->getSmscAddress(serial);
@@ -499,6 +604,13 @@
* Test IRadioMessaging.setSmscAddress() for the response returned.
*/
TEST_P(RadioMessagingTest, setSmscAddress) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_MESSAGING)) {
+ GTEST_SKIP() << "Skipping setSmscAddress "
+ "due to undefined FEATURE_TELEPHONY_MESSAGING";
+ }
+ }
+
serial = GetRandomSerialNumber();
std::string address = std::string("smscAddress");
@@ -520,6 +632,13 @@
* Test IRadioMessaging.writeSmsToSim() for the response returned.
*/
TEST_P(RadioMessagingTest, writeSmsToSim) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_MESSAGING)) {
+ GTEST_SKIP() << "Skipping writeSmsToSim "
+ "due to undefined FEATURE_TELEPHONY_MESSAGING";
+ }
+ }
+
serial = GetRandomSerialNumber();
SmsWriteArgs smsWriteArgs;
smsWriteArgs.status = SmsWriteArgs::STATUS_REC_UNREAD;
@@ -546,6 +665,13 @@
* Test IRadioMessaging.deleteSmsOnSim() for the response returned.
*/
TEST_P(RadioMessagingTest, deleteSmsOnSim) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_MESSAGING)) {
+ GTEST_SKIP() << "Skipping deleteSmsOnSim "
+ "due to undefined FEATURE_TELEPHONY_MESSAGING";
+ }
+ }
+
serial = GetRandomSerialNumber();
int index = 1;
@@ -569,6 +695,13 @@
* Test IRadioMessaging.writeSmsToRuim() for the response returned.
*/
TEST_P(RadioMessagingTest, writeSmsToRuim) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ GTEST_SKIP() << "Skipping writeSmsToRuim "
+ "due to undefined FEATURE_TELEPHONY_CDMA";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Create a CdmaSmsAddress
@@ -620,6 +753,13 @@
* Test IRadioMessaging.deleteSmsOnRuim() for the response returned.
*/
TEST_P(RadioMessagingTest, deleteSmsOnRuim) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ GTEST_SKIP() << "Skipping deleteSmsOnRuim "
+ "due to undefined FEATURE_TELEPHONY_CDMA";
+ }
+ }
+
serial = GetRandomSerialNumber();
int index = 1;
@@ -671,6 +811,13 @@
* Test IRadioMessaging.reportSmsMemoryStatus() for the response returned.
*/
TEST_P(RadioMessagingTest, reportSmsMemoryStatus) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_MESSAGING)) {
+ GTEST_SKIP() << "Skipping reportSmsMemoryStatus "
+ "due to undefined FEATURE_TELEPHONY_MESSAGING";
+ }
+ }
+
serial = GetRandomSerialNumber();
bool available = true;
diff --git a/radio/aidl/vts/radio_modem_test.cpp b/radio/aidl/vts/radio_modem_test.cpp
index c48a461..6a9996b 100644
--- a/radio/aidl/vts/radio_modem_test.cpp
+++ b/radio/aidl/vts/radio_modem_test.cpp
@@ -59,6 +59,13 @@
* Test IRadioModem.setRadioPower() for the response returned.
*/
TEST_P(RadioModemTest, setRadioPower_emergencyCall_cancelled) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setRadioPower_emergencyCall_cancelled "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
// Set radio power to off.
serial = GetRandomSerialNumber();
radio_modem->setRadioPower(serial, false, false, false);
@@ -90,6 +97,13 @@
* Test IRadioModem.enableModem() for the response returned.
*/
TEST_P(RadioModemTest, enableModem) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY)) {
+ GTEST_SKIP() << "Skipping enableModem "
+ "due to undefined FEATURE_TELEPHONY";
+ }
+ }
+
serial = GetRandomSerialNumber();
if (isSsSsEnabled()) {
@@ -134,6 +148,13 @@
* Test IRadioModem.getModemStackStatus() for the response returned.
*/
TEST_P(RadioModemTest, getModemStackStatus) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY)) {
+ GTEST_SKIP() << "Skipping getModemStackStatus "
+ "due to undefined FEATURE_TELEPHONY";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_modem->getModemStackStatus(serial);
@@ -152,6 +173,13 @@
* Test IRadioModem.getBasebandVersion() for the response returned.
*/
TEST_P(RadioModemTest, getBasebandVersion) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY)) {
+ GTEST_SKIP() << "Skipping getBasebandVersion "
+ "due to undefined FEATURE_TELEPHONY";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_modem->getBasebandVersion(serial);
@@ -168,6 +196,13 @@
* Test IRadioModem.getDeviceIdentity() for the response returned.
*/
TEST_P(RadioModemTest, getDeviceIdentity) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY)) {
+ GTEST_SKIP() << "Skipping getDeviceIdentity "
+ "due to undefined FEATURE_TELEPHONY";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_modem->getDeviceIdentity(serial);
@@ -185,6 +220,13 @@
* Test IRadioModem.getImei() for the response returned.
*/
TEST_P(RadioModemTest, getImei) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_GSM)) {
+ GTEST_SKIP() << "Skipping getImei "
+ "due to undefined FEATURE_TELEPHONY_GSM";
+ }
+ }
+
int32_t aidl_version;
ndk::ScopedAStatus aidl_status = radio_modem->getInterfaceVersion(&aidl_version);
ASSERT_OK(aidl_status);
@@ -246,6 +288,13 @@
* Test IRadioModem.nvWriteCdmaPrl() for the response returned.
*/
TEST_P(RadioModemTest, nvWriteCdmaPrl) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ GTEST_SKIP() << "Skipping nvWriteCdmaPrl "
+ "due to undefined FEATURE_TELEPHONY_CDMA";
+ }
+ }
+
serial = GetRandomSerialNumber();
std::vector<uint8_t> prl = {1, 2, 3, 4, 5};
@@ -283,6 +332,13 @@
* Test IRadioModem.getHardwareConfig() for the response returned.
*/
TEST_P(RadioModemTest, getHardwareConfig) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY)) {
+ GTEST_SKIP() << "Skipping getHardwareConfig "
+ "due to undefined FEATURE_TELEPHONY";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_modem->getHardwareConfig(serial);
@@ -302,6 +358,13 @@
* Test IRadioModem.requestShutdown() for the response returned.
*/
TEST_P(RadioModemTest, DISABLED_requestShutdown) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping DISABLED_requestShutdown "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_modem->requestShutdown(serial);
@@ -319,6 +382,13 @@
* Test IRadioModem.getRadioCapability() for the response returned.
*/
TEST_P(RadioModemTest, getRadioCapability) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping getRadioCapability "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_modem->getRadioCapability(serial);
@@ -335,6 +405,13 @@
* Test IRadioModem.setRadioCapability() for the response returned.
*/
TEST_P(RadioModemTest, setRadioCapability) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setRadioCapability "
+ "due to undefined FEATURE_TELEPHONY";
+ }
+ }
+
serial = GetRandomSerialNumber();
RadioCapability rc;
memset(&rc, 0, sizeof(rc));
@@ -356,6 +433,13 @@
* Test IRadioModem.getModemActivityInfo() for the response returned.
*/
TEST_P(RadioModemTest, getModemActivityInfo) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping getModemActivityInfo "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_modem->getModemActivityInfo(serial);
@@ -373,6 +457,13 @@
* Test IRadioModem.sendDeviceState() for the response returned.
*/
TEST_P(RadioModemTest, sendDeviceState) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY)) {
+ GTEST_SKIP() << "Skipping sendDeviceState "
+ "due to undefined FEATURE_TELEPHONY";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_modem->sendDeviceState(serial, DeviceStateType::POWER_SAVE_MODE, true);
diff --git a/radio/aidl/vts/radio_network_indication.cpp b/radio/aidl/vts/radio_network_indication.cpp
index aa14af7..9614783 100644
--- a/radio/aidl/vts/radio_network_indication.cpp
+++ b/radio/aidl/vts/radio_network_indication.cpp
@@ -103,3 +103,8 @@
const CellularIdentifierDisclosure& /*disclosures*/) {
return ndk::ScopedAStatus::ok();
}
+
+ndk::ScopedAStatus RadioNetworkIndication::securityAlgorithmsUpdated(
+ RadioIndicationType /*type*/, const SecurityAlgorithmUpdate& /*securityAlgorithmUpdate*/) {
+ return ndk::ScopedAStatus::ok();
+}
diff --git a/radio/aidl/vts/radio_network_response.cpp b/radio/aidl/vts/radio_network_response.cpp
index 8c04591..4d452d0 100644
--- a/radio/aidl/vts/radio_network_response.cpp
+++ b/radio/aidl/vts/radio_network_response.cpp
@@ -335,3 +335,18 @@
parent_network.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
+
+ndk::ScopedAStatus RadioNetworkResponse::setSecurityAlgorithmsUpdatedEnabledResponse(
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_network.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::isSecurityAlgorithmsUpdatedEnabledResponse(
+ const RadioResponseInfo& info, bool enabled) {
+ rspInfo = info;
+ this->isSecurityAlgorithmsUpdatedEnabled = enabled;
+ parent_network.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
diff --git a/radio/aidl/vts/radio_network_test.cpp b/radio/aidl/vts/radio_network_test.cpp
index 8254873..c893553 100644
--- a/radio/aidl/vts/radio_network_test.cpp
+++ b/radio/aidl/vts/radio_network_test.cpp
@@ -81,6 +81,13 @@
* for the response returned.
*/
TEST_P(RadioNetworkTest, setGetAllowedNetworkTypesBitmap) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setGetAllowedNetworkTypesBitmap "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
// save current value
@@ -133,6 +140,13 @@
* Test IRadioNetwork.setNrDualConnectivityState() for the response returned.
*/
TEST_P(RadioNetworkTest, setNrDualConnectivityState) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setNrDualConnectivityState "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res =
@@ -157,6 +171,13 @@
* Test IRadioNetwork.isNrDualConnectivityEnabled() for the response returned.
*/
TEST_P(RadioNetworkTest, isNrDualConnectivityEnabled) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping isNrDualConnectivityEnabled "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_network->isNrDualConnectivityEnabled(serial);
@@ -195,6 +216,13 @@
* Verify that the usage setting can be retrieved.
*/
TEST_P(RadioNetworkTest, getUsageSetting) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY)) {
+ GTEST_SKIP() << "Skipping getUsageSetting "
+ "due to undefined FEATURE_TELEPHONY";
+ }
+ }
+
invokeAndExpectResponse([&](int serial) { return radio_network->getUsageSetting(serial); },
{RadioError::RADIO_NOT_AVAILABLE, RadioError::INVALID_STATE,
RadioError::SIM_ABSENT, RadioError::INTERNAL_ERR, RadioError::NONE});
@@ -232,6 +260,13 @@
* -That the usage setting cannot be set to invalid values.
*/
TEST_P(RadioNetworkTest, setUsageSetting) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY)) {
+ GTEST_SKIP() << "Skipping setUsageSetting "
+ "due to undefined FEATURE_TELEPHONY";
+ }
+ }
+
invokeAndExpectResponse([&](int serial) { return radio_network->getUsageSetting(serial); },
{RadioError::RADIO_NOT_AVAILABLE, RadioError::INVALID_STATE,
RadioError::SIM_ABSENT, RadioError::INTERNAL_ERR, RadioError::NONE});
@@ -294,6 +329,13 @@
* Test IRadioNetwork.setSignalStrengthReportingCriteria() with invalid hysteresisDb
*/
TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_invalidHysteresisDb) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setSignalStrengthReportingCriteria_invalidHysteresisDb "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
SignalThresholdInfo signalThresholdInfo;
@@ -320,6 +362,13 @@
* Test IRadioNetwork.setSignalStrengthReportingCriteria() with empty thresholds
*/
TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_EmptyThresholds) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setSignalStrengthReportingCriteria_EmptyThresholds "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
SignalThresholdInfo signalThresholdInfo;
@@ -345,6 +394,13 @@
* Test IRadioNetwork.setSignalStrengthReportingCriteria() for GERAN
*/
TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Geran) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setSignalStrengthReportingCriteria_Geran "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
SignalThresholdInfo signalThresholdInfo;
@@ -372,6 +428,13 @@
* Test IRadioNetwork.setSignalStrengthReportingCriteria() for UTRAN
*/
TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Utran_Rscp) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setSignalStrengthReportingCriteria_Utran_Rscp "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
SignalThresholdInfo signalThresholdInfo;
@@ -398,6 +461,13 @@
* Test IRadioNetwork.setSignalStrengthReportingCriteria() for UTRAN
*/
TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Utran_Ecno) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setSignalStrengthReportingCriteria_Utran_Ecno "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
SignalThresholdInfo signalThresholdInfo;
@@ -425,6 +495,13 @@
* Test IRadioNetwork.setSignalStrengthReportingCriteria() for EUTRAN
*/
TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Eutran_RSRP) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setSignalStrengthReportingCriteria_Eutran_RSRP "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
SignalThresholdInfo signalThresholdInfo;
@@ -451,6 +528,13 @@
* Test IRadioNetwork.setSignalStrengthReportingCriteria() for EUTRAN
*/
TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Eutran_RSRQ) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setSignalStrengthReportingCriteria_Eutran_RSRQ "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
SignalThresholdInfo signalThresholdInfo;
@@ -477,6 +561,13 @@
* Test IRadioNetwork.setSignalStrengthReportingCriteria() for EUTRAN
*/
TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Eutran_RSSNR) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setSignalStrengthReportingCriteria_Eutran_RSSNR "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
SignalThresholdInfo signalThresholdInfo;
@@ -499,6 +590,13 @@
* Test IRadioNetwork.setSignalStrengthReportingCriteria() for CDMA2000
*/
TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Cdma2000) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setSignalStrengthReportingCriteria_Cdma2000 "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
SignalThresholdInfo signalThresholdInfo;
@@ -525,6 +623,13 @@
* Test IRadioNetwork.setSignalStrengthReportingCriteria() for NGRAN_SSRSRP
*/
TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_NGRAN_SSRSRP) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setSignalStrengthReportingCriteria_NGRAN_SSRSRP "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
SignalThresholdInfo signalThresholdInfo;
@@ -555,6 +660,13 @@
* Test IRadioNetwork.setSignalStrengthReportingCriteria() for NGRAN_SSRSRQ
*/
TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_NGRAN_SSRSRQ) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setSignalStrengthReportingCriteria_NGRAN_SSRSRQ "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
SignalThresholdInfo signalThresholdInfo;
@@ -585,6 +697,13 @@
* Test IRadioNetwork.setSignalStrengthReportingCriteria() for EUTRAN
*/
TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Disable_RSSNR) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setSignalStrengthReportingCriteria_Disable_RSSNR "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
SignalThresholdInfo signalThresholdInfo;
@@ -607,6 +726,13 @@
* Test IRadioNetwork.setSignalStrengthReportingCriteria() for NGRAN_SSSINR
*/
TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_NGRAN_SSSINR) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setSignalStrengthReportingCriteria_NGRAN_SSSINR "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
SignalThresholdInfo signalThresholdInfo;
@@ -637,6 +763,13 @@
* Test IRadioNetwork.setSignalStrengthReportingCriteria() for multi-RANs per request
*/
TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_multiRansPerRequest) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setSignalStrengthReportingCriteria_multiRansPerRequest "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
SignalThresholdInfo signalThresholdInfoGeran;
signalThresholdInfoGeran.signalMeasurement = SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_RSSI;
signalThresholdInfoGeran.hysteresisMs = 5000;
@@ -720,6 +853,13 @@
* Test IRadioNetwork.setLinkCapacityReportingCriteria() invalid hysteresisDlKbps
*/
TEST_P(RadioNetworkTest, setLinkCapacityReportingCriteria_invalidHysteresisDlKbps) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setLinkCapacityReportingCriteria_invalidHysteresisDlKbps "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_network->setLinkCapacityReportingCriteria(
@@ -740,6 +880,13 @@
* Test IRadioNetwork.setLinkCapacityReportingCriteria() invalid hysteresisUlKbps
*/
TEST_P(RadioNetworkTest, setLinkCapacityReportingCriteria_invalidHysteresisUlKbps) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setLinkCapacityReportingCriteria_invalidHysteresisUlKbps "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_network->setLinkCapacityReportingCriteria(
@@ -759,6 +906,13 @@
* Test IRadioNetwork.setLinkCapacityReportingCriteria() empty params
*/
TEST_P(RadioNetworkTest, setLinkCapacityReportingCriteria_emptyParams) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setLinkCapacityReportingCriteria_emptyParams "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_network->setLinkCapacityReportingCriteria(
@@ -777,6 +931,13 @@
* Test IRadioNetwork.setLinkCapacityReportingCriteria() for GERAN
*/
TEST_P(RadioNetworkTest, setLinkCapacityReportingCriteria_Geran) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setLinkCapacityReportingCriteria_Geran "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_network->setLinkCapacityReportingCriteria(
@@ -799,6 +960,13 @@
* Test IRadioNetwork.setSystemSelectionChannels() for the response returned.
*/
TEST_P(RadioNetworkTest, setSystemSelectionChannels) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setSystemSelectionChannels "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_network->getSystemSelectionChannels(serial);
EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -848,6 +1016,13 @@
* Test IRadioNetwork.startNetworkScan() for the response returned.
*/
TEST_P(RadioNetworkTest, startNetworkScan) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping startNetworkScan "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
@@ -890,6 +1065,13 @@
* Test IRadioNetwork.startNetworkScan() with invalid specifier.
*/
TEST_P(RadioNetworkTest, startNetworkScan_InvalidArgument) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping startNetworkScan_InvalidArgument "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT, .interval = 60};
@@ -915,6 +1097,13 @@
* Test IRadioNetwork.startNetworkScan() with invalid interval (lower boundary).
*/
TEST_P(RadioNetworkTest, startNetworkScan_InvalidInterval1) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping startNetworkScan_InvalidInterval1 "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_PERIODIC,
@@ -944,6 +1133,13 @@
* Test IRadioNetwork.startNetworkScan() with invalid interval (upper boundary).
*/
TEST_P(RadioNetworkTest, startNetworkScan_InvalidInterval2) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping startNetworkScan_InvalidInterval2 "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_PERIODIC,
@@ -973,6 +1169,13 @@
* Test IRadioNetwork.startNetworkScan() with invalid max search time (lower boundary).
*/
TEST_P(RadioNetworkTest, startNetworkScan_InvalidMaxSearchTime1) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping startNetworkScan_InvalidMaxSearchTime1 "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
@@ -1002,6 +1205,13 @@
* Test IRadioNetwork.startNetworkScan() with invalid max search time (upper boundary).
*/
TEST_P(RadioNetworkTest, startNetworkScan_InvalidMaxSearchTime2) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping startNetworkScan_InvalidMaxSearchTime2 "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
@@ -1031,6 +1241,13 @@
* Test IRadioNetwork.startNetworkScan() with invalid periodicity (lower boundary).
*/
TEST_P(RadioNetworkTest, startNetworkScan_InvalidPeriodicity1) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping startNetworkScan_InvalidPeriodicity1 "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
@@ -1060,6 +1277,13 @@
* Test IRadioNetwork.startNetworkScan() with invalid periodicity (upper boundary).
*/
TEST_P(RadioNetworkTest, startNetworkScan_InvalidPeriodicity2) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping startNetworkScan_InvalidPeriodicity2 "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
@@ -1089,6 +1313,13 @@
* Test IRadioNetwork.startNetworkScan() with valid periodicity
*/
TEST_P(RadioNetworkTest, startNetworkScan_GoodRequest1) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping startNetworkScan_GoodRequest1 "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
@@ -1123,6 +1354,13 @@
* Test IRadioNetwork.startNetworkScan() with valid periodicity and plmns
*/
TEST_P(RadioNetworkTest, startNetworkScan_GoodRequest2) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping startNetworkScan_GoodRequest2 "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
@@ -1158,6 +1396,13 @@
* Test IRadioNetwork.setNetworkSelectionModeManual() for the response returned.
*/
TEST_P(RadioNetworkTest, setNetworkSelectionModeManual) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setNetworkSelectionModeManual "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
// can't camp on nonexistent MCCMNC, so we expect this to fail.
@@ -1186,6 +1431,13 @@
* Test IRadioNetwork.getBarringInfo() for the response returned.
*/
TEST_P(RadioNetworkTest, getBarringInfo) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping getBarringInfo "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_network->getBarringInfo(serial);
EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -1290,6 +1542,13 @@
* Test IRadioNetwork.getSignalStrength() for the response returned.
*/
TEST_P(RadioNetworkTest, getSignalStrength) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping getSignalStrength "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_network->getSignalStrength(serial);
@@ -1309,6 +1568,13 @@
* Test IRadioNetwork.getCellInfoList() for the response returned.
*/
TEST_P(RadioNetworkTest, getCellInfoList) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping getCellInfoList "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_network->getCellInfoList(serial);
@@ -1327,6 +1593,13 @@
* Test IRadioNetwork.getVoiceRegistrationState() for the response returned.
*/
TEST_P(RadioNetworkTest, getVoiceRegistrationState) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping getVoiceRegistrationState "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_network->getVoiceRegistrationState(serial);
@@ -1345,6 +1618,13 @@
* Test IRadioNetwork.getDataRegistrationState() for the response returned.
*/
TEST_P(RadioNetworkTest, getDataRegistrationState) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping getDataRegistrationState "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_network->getDataRegistrationState(serial);
@@ -1440,6 +1720,13 @@
* Test IRadioNetwork.getAvailableBandModes() for the response returned.
*/
TEST_P(RadioNetworkTest, getAvailableBandModes) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping getAvailableBandModes "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_network->getAvailableBandModes(serial);
@@ -1469,6 +1756,13 @@
* Test IRadioNetwork.setIndicationFilter()
*/
TEST_P(RadioNetworkTest, setIndicationFilter) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setIndicationFilter "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res =
@@ -1487,6 +1781,13 @@
* Test IRadioNetwork.setBarringPassword() for the response returned.
*/
TEST_P(RadioNetworkTest, setBarringPassword) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setBarringPassword "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
std::string facility = "";
std::string oldPassword = "";
@@ -1510,6 +1811,13 @@
* Test IRadioNetwork.setSuppServiceNotifications() for the response returned.
*/
TEST_P(RadioNetworkTest, setSuppServiceNotifications) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping setSuppServiceNotifications "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
bool enable = false;
@@ -1529,6 +1837,13 @@
* Test IRadioNetwork.getImsRegistrationState() for the response returned.
*/
TEST_P(RadioNetworkTest, getImsRegistrationState) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_IMS)) {
+ GTEST_SKIP() << "Skipping getImsRegistrationState "
+ "due to undefined FEATURE_TELEPHONY_IMS";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_network->getImsRegistrationState(serial);
@@ -1549,6 +1864,13 @@
* Test IRadioNetwork.getOperator() for the response returned.
*/
TEST_P(RadioNetworkTest, getOperator) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping getOperator "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_network->getOperator(serial);
@@ -1565,6 +1887,13 @@
* Test IRadioNetwork.getNetworkSelectionMode() for the response returned.
*/
TEST_P(RadioNetworkTest, getNetworkSelectionMode) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping getNetworkSelectionMode "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_network->getNetworkSelectionMode(serial);
@@ -1581,6 +1910,13 @@
* Test IRadioNetwork.setNetworkSelectionModeAutomatic() for the response returned.
*/
TEST_P(RadioNetworkTest, setNetworkSelectionModeAutomatic) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setNetworkSelectionModeAutomatic "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_network->setNetworkSelectionModeAutomatic(serial);
@@ -1600,6 +1936,13 @@
* Test IRadioNetwork.getAvailableNetworks() for the response returned.
*/
TEST_P(RadioNetworkTest, getAvailableNetworks) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping getAvailableNetworks "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_network->getAvailableNetworks(serial);
@@ -1621,6 +1964,13 @@
* Test IRadioNetwork.setBandMode() for the response returned.
*/
TEST_P(RadioNetworkTest, setBandMode) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setBandMode "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_network->setBandMode(serial, RadioBandMode::BAND_MODE_USA);
@@ -1638,6 +1988,13 @@
* Test IRadioNetwork.setLocationUpdates() for the response returned.
*/
TEST_P(RadioNetworkTest, setLocationUpdates) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setLocationUpdates "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_network->setLocationUpdates(serial, true);
@@ -1655,6 +2012,13 @@
* Test IRadioNetwork.setCdmaRoamingPreference() for the response returned.
*/
TEST_P(RadioNetworkTest, setCdmaRoamingPreference) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ GTEST_SKIP() << "Skipping setCdmaRoamingPreference "
+ "due to undefined FEATURE_TELEPHONY_CDMA";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_network->setCdmaRoamingPreference(serial, CdmaRoamingType::HOME_NETWORK);
@@ -1673,6 +2037,13 @@
* Test IRadioNetwork.getCdmaRoamingPreference() for the response returned.
*/
TEST_P(RadioNetworkTest, getCdmaRoamingPreference) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ GTEST_SKIP() << "Skipping getCdmaRoamingPreference "
+ "due to undefined FEATURE_TELEPHONY_CDMA";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_network->getCdmaRoamingPreference(serial);
@@ -1692,6 +2063,13 @@
* Test IRadioNetwork.getVoiceRadioTechnology() for the response returned.
*/
TEST_P(RadioNetworkTest, getVoiceRadioTechnology) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping getVoiceRadioTechnology "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_network->getVoiceRadioTechnology(serial);
@@ -1708,6 +2086,13 @@
* Test IRadioNetwork.setCellInfoListRate() for the response returned.
*/
TEST_P(RadioNetworkTest, setCellInfoListRate) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setCellInfoListRate "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_network->setCellInfoListRate(serial, 10);
@@ -1725,6 +2110,13 @@
* Test IRadioNetwork.supplyNetworkDepersonalization() for the response returned.
*/
TEST_P(RadioNetworkTest, supplyNetworkDepersonalization) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping supplyNetworkDepersonalization "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_network->supplyNetworkDepersonalization(serial, std::string("test"));
@@ -1745,6 +2137,13 @@
* Test IRadioNetwork.setEmergencyMode() for the response returned.
*/
TEST_P(RadioNetworkTest, setEmergencyMode) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setEmergencyMode "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
int32_t aidl_version;
ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version);
ASSERT_OK(aidl_status);
@@ -1774,6 +2173,13 @@
* Test IRadioNetwork.triggerEmergencyNetworkScan() for the response returned.
*/
TEST_P(RadioNetworkTest, triggerEmergencyNetworkScan) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping triggerEmergencyNetworkScan "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
int32_t aidl_version;
ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version);
ASSERT_OK(aidl_status);
@@ -1804,6 +2210,13 @@
* Test IRadioNetwork.cancelEmergencyNetworkScan() for the response returned.
*/
TEST_P(RadioNetworkTest, cancelEmergencyNetworkScan) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping cancelEmergencyNetworkScan "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
int32_t aidl_version;
ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version);
ASSERT_OK(aidl_status);
@@ -1828,6 +2241,13 @@
* Test IRadioNetwork.exitEmergencyMode() for the response returned.
*/
TEST_P(RadioNetworkTest, exitEmergencyMode) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping exitEmergencyMode "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
int32_t aidl_version;
ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version);
ASSERT_OK(aidl_status);
@@ -1852,6 +2272,13 @@
* Test IRadioNetwork.setN1ModeEnabled() for the response returned.
*/
TEST_P(RadioNetworkTest, setN1ModeEnabled) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setN1ModeEnabled "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
int32_t aidl_version;
ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version);
ASSERT_OK(aidl_status);
@@ -1884,6 +2311,13 @@
* Test IRadioNetwork.isN1ModeEnabled() for the response returned.
*/
TEST_P(RadioNetworkTest, isN1ModeEnabled) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping isN1ModeEnabled "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
int32_t aidl_version;
ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version);
ASSERT_OK(aidl_status);
@@ -1915,6 +2349,13 @@
* Test IRadioNetwork.setNullCipherAndIntegrityEnabled() for the response returned.
*/
TEST_P(RadioNetworkTest, setNullCipherAndIntegrityEnabled) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setNullCipherAndIntegrityEnabled "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
int32_t aidl_version;
ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version);
ASSERT_OK(aidl_status);
@@ -1940,6 +2381,13 @@
* Test IRadioNetwork.isNullCipherAndIntegrityEnabled() for the response returned.
*/
TEST_P(RadioNetworkTest, isNullCipherAndIntegrityEnabled) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping isNullCipherAndIntegrityEnabled "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
int32_t aidl_version;
ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version);
ASSERT_OK(aidl_status);
@@ -2040,3 +2488,86 @@
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
}
+
+/*
+ * Test IRadioNetwork.setSecurityAlgorithmsUpdatedEnabled for the response returned.
+ */
+TEST_P(RadioNetworkTest, setSecurityAlgorithmsUpdatedEnabled) {
+ int32_t aidl_version;
+ ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version);
+ ASSERT_OK(aidl_status);
+ if (aidl_version < 3) {
+ ALOGI("Skipped the test since"
+ " setSecurityAlgorithmsUpdatedEnabled is not supported on version < 3");
+ GTEST_SKIP();
+ }
+
+ // Get current value
+ serial = GetRandomSerialNumber();
+ radio_network->isSecurityAlgorithmsUpdatedEnabled(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ bool originalSecuritySetting = radioRsp_network->isSecurityAlgorithmsUpdatedEnabled;
+
+ // We want to test flipping the value, so we are going to set it to the opposite of what
+ // the existing setting is. The test for isSecurityAlgorithmsUpdatedEnabled should check
+ // for the right default value.
+ bool valueToSet = !originalSecuritySetting;
+ serial = GetRandomSerialNumber();
+ radio_network->setSecurityAlgorithmsUpdatedEnabled(serial, valueToSet);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR}));
+
+ // Assert the value has changed
+ serial = GetRandomSerialNumber();
+ ndk::ScopedAStatus res = radio_network->isSecurityAlgorithmsUpdatedEnabled(serial);
+
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR}));
+ EXPECT_EQ(valueToSet, radioRsp_network->isSecurityAlgorithmsUpdatedEnabled);
+
+ // Reset original state
+ radio_network->setSecurityAlgorithmsUpdatedEnabled(serial, originalSecuritySetting);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+}
+
+/**
+ * Test IRadioNetwork.isSecurityAlgorithmsUpdatedEnabled for the response returned.
+ */
+TEST_P(RadioNetworkTest, isSecurityAlgorithmsUpdatedEnabled) {
+ int32_t aidl_version;
+ ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version);
+ ASSERT_OK(aidl_status);
+ if (aidl_version < 3) {
+ ALOGI("Skipped the test since"
+ " isSecurityAlgorithmsUpdatedEnabled is not supported on version < 3");
+ GTEST_SKIP();
+ }
+
+ serial = GetRandomSerialNumber();
+
+ ndk::ScopedAStatus res = radio_network->isSecurityAlgorithmsUpdatedEnabled(serial);
+ ASSERT_OK(res);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR}));
+
+ // the default value should be true if we have not called the setter
+ EXPECT_TRUE(radioRsp_network->isSecurityAlgorithmsUpdatedEnabled);
+}
diff --git a/radio/aidl/vts/radio_network_utils.h b/radio/aidl/vts/radio_network_utils.h
index 5cd4245..470ee73 100644
--- a/radio/aidl/vts/radio_network_utils.h
+++ b/radio/aidl/vts/radio_network_utils.h
@@ -47,6 +47,7 @@
UsageSetting usageSetting;
std::vector<RadioAccessSpecifier> specifiers;
bool isCellularIdentifierTransparencyEnabled;
+ bool isSecurityAlgorithmsUpdatedEnabled;
virtual ndk::ScopedAStatus acknowledgeRequest(int32_t serial) override;
@@ -176,6 +177,12 @@
virtual ndk::ScopedAStatus isCellularIdentifierTransparencyEnabledResponse(
const RadioResponseInfo& info, bool /*enabled*/) override;
+
+ virtual ndk::ScopedAStatus isSecurityAlgorithmsUpdatedEnabledResponse(
+ const RadioResponseInfo& info, bool isEnabled) override;
+
+ virtual ndk::ScopedAStatus setSecurityAlgorithmsUpdatedEnabledResponse(
+ const RadioResponseInfo& info) override;
};
/* Callback class for radio network indication */
@@ -236,6 +243,10 @@
virtual ndk::ScopedAStatus cellularIdentifierDisclosed(
RadioIndicationType type, const CellularIdentifierDisclosure& disclosures) override;
+
+ virtual ndk::ScopedAStatus securityAlgorithmsUpdated(
+ RadioIndicationType type,
+ const SecurityAlgorithmUpdate& securityAlgorithmUpdate) override;
};
// The main test class for Radio AIDL Network.
diff --git a/radio/aidl/vts/radio_sap_test.cpp b/radio/aidl/vts/radio_sap_test.cpp
index 9a1c145..6d283e9 100644
--- a/radio/aidl/vts/radio_sap_test.cpp
+++ b/radio/aidl/vts/radio_sap_test.cpp
@@ -85,6 +85,13 @@
* Test ISap.connectReq() for the response returned.
*/
TEST_P(SapTest, connectReq) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping connectReq "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
int32_t maxMsgSize = 100;
@@ -103,6 +110,13 @@
* Test ISap.disconnectReq() for the response returned
*/
TEST_P(SapTest, disconnectReq) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping disconnectReq "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = sap->disconnectReq(serial);
@@ -116,6 +130,13 @@
* Test ISap.apduReq() for the response returned.
*/
TEST_P(SapTest, apduReq) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping apduReq "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
SapApduType sapApduType = SapApduType::APDU;
std::vector<uint8_t> command = {};
@@ -137,6 +158,13 @@
* Test ISap.transferAtrReq() for the response returned.
*/
TEST_P(SapTest, transferAtrReq) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping transferAtrReq "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = sap->transferAtrReq(serial);
@@ -155,6 +183,13 @@
* Test ISap.powerReq() for the response returned.
*/
TEST_P(SapTest, powerReq) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping powerReq "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
bool state = true;
@@ -175,6 +210,13 @@
* Test ISap.resetSimReq() for the response returned.
*/
TEST_P(SapTest, resetSimReq) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping resetSimReq "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = sap->resetSimReq(serial);
@@ -194,6 +236,13 @@
* Test ISap.transferCardReaderStatusReq() for the response returned.
*/
TEST_P(SapTest, transferCardReaderStatusReq) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping transferCardReaderStatusReq "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = sap->transferCardReaderStatusReq(serial);
@@ -211,6 +260,13 @@
* Test ISap.setTransferProtocolReq() for the response returned.
*/
TEST_P(SapTest, setTransferProtocolReq) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping setTransferProtocolReq "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
SapTransferProtocol sapTransferProtocol = SapTransferProtocol::T0;
diff --git a/radio/aidl/vts/radio_sim_test.cpp b/radio/aidl/vts/radio_sim_test.cpp
index d906588..06654c2 100644
--- a/radio/aidl/vts/radio_sim_test.cpp
+++ b/radio/aidl/vts/radio_sim_test.cpp
@@ -65,6 +65,13 @@
* Test IRadioSim.setSimCardPower() for the response returned.
*/
TEST_P(RadioSimTest, setSimCardPower) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping setSimCardPower "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
/* Test setSimCardPower power down */
serial = GetRandomSerialNumber();
radio_sim->setSimCardPower(serial, CardPowerState::POWER_DOWN);
@@ -120,6 +127,13 @@
* Test IRadioSim.setCarrierInfoForImsiEncryption() for the response returned.
*/
TEST_P(RadioSimTest, setCarrierInfoForImsiEncryption) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping setCarrierInfoForImsiEncryption "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
ImsiEncryptionInfo imsiInfo;
imsiInfo.mcc = "310";
@@ -144,6 +158,13 @@
* Test IRadioSim.getSimPhonebookRecords() for the response returned.
*/
TEST_P(RadioSimTest, getSimPhonebookRecords) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping getSimPhonebookRecords "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_sim->getSimPhonebookRecords(serial);
EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -167,6 +188,13 @@
* Test IRadioSim.getSimPhonebookCapacity for the response returned.
*/
TEST_P(RadioSimTest, getSimPhonebookCapacity) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping getSimPhonebookCapacity "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_sim->getSimPhonebookCapacity(serial);
EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -207,6 +235,13 @@
* Test IRadioSim.updateSimPhonebookRecords() for the response returned.
*/
TEST_P(RadioSimTest, updateSimPhonebookRecords) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping updateSimPhonebookRecords "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_sim->getSimPhonebookCapacity(serial);
EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -271,6 +306,13 @@
* For SIM ABSENT case.
*/
TEST_P(RadioSimTest, togglingUiccApplicationsSimAbsent) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping togglingUiccApplicationsSimAbsent "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
// This test case only test SIM ABSENT case.
if (cardStatus.cardState != CardStatus::STATE_ABSENT) return;
@@ -298,6 +340,13 @@
* For SIM PRESENT case.
*/
TEST_P(RadioSimTest, togglingUiccApplicationsSimPresent) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping togglingUiccApplicationsSimPresent "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
// This test case only test SIM ABSENT case.
if (cardStatus.cardState != CardStatus::STATE_PRESENT) return;
if (cardStatus.applications.size() == 0) return;
@@ -345,6 +394,13 @@
* Test IRadioSim.areUiccApplicationsEnabled() for the response returned.
*/
TEST_P(RadioSimTest, areUiccApplicationsEnabled) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping areUiccApplicationsEnabled "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
// Disable Uicc applications.
serial = GetRandomSerialNumber();
radio_sim->areUiccApplicationsEnabled(serial);
@@ -365,6 +421,13 @@
* Test IRadioSim.getAllowedCarriers() for the response returned.
*/
TEST_P(RadioSimTest, getAllowedCarriers) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping getAllowedCarriers "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_sim->getAllowedCarriers(serial);
@@ -380,6 +443,13 @@
* Test IRadioSim.setAllowedCarriers() for the response returned.
*/
TEST_P(RadioSimTest, setAllowedCarriers) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping setAllowedCarriers "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
CarrierRestrictions carrierRestrictions;
memset(&carrierRestrictions, 0, sizeof(carrierRestrictions));
@@ -479,6 +549,13 @@
* Test IRadioSim.getIccCardStatus() for the response returned.
*/
TEST_P(RadioSimTest, getIccCardStatus) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping getIccCardStatus "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
EXPECT_LE(cardStatus.applications.size(), RadioConst::CARD_MAX_APPS);
EXPECT_LT(cardStatus.gsmUmtsSubscriptionAppIndex, RadioConst::CARD_MAX_APPS);
EXPECT_LT(cardStatus.cdmaSubscriptionAppIndex, RadioConst::CARD_MAX_APPS);
@@ -489,6 +566,13 @@
* Test IRadioSim.supplyIccPinForApp() for the response returned
*/
TEST_P(RadioSimTest, supplyIccPinForApp) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping supplyIccPinForApp "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
@@ -514,6 +598,13 @@
* Test IRadioSim.supplyIccPukForApp() for the response returned.
*/
TEST_P(RadioSimTest, supplyIccPukForApp) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping supplyIccPukForApp "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
@@ -539,6 +630,13 @@
* Test IRadioSim.supplyIccPin2ForApp() for the response returned.
*/
TEST_P(RadioSimTest, supplyIccPin2ForApp) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping supplyIccPin2ForApp "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
@@ -565,6 +663,13 @@
* Test IRadioSim.supplyIccPuk2ForApp() for the response returned.
*/
TEST_P(RadioSimTest, supplyIccPuk2ForApp) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping supplyIccPuk2ForApp "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
@@ -590,6 +695,13 @@
* Test IRadioSim.changeIccPinForApp() for the response returned.
*/
TEST_P(RadioSimTest, changeIccPinForApp) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping changeIccPinForApp "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
@@ -615,6 +727,13 @@
* Test IRadioSim.changeIccPin2ForApp() for the response returned.
*/
TEST_P(RadioSimTest, changeIccPin2ForApp) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping changeIccPin2ForApp "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
@@ -641,6 +760,13 @@
* Test IRadioSim.getImsiForApp() for the response returned.
*/
TEST_P(RadioSimTest, getImsiForApp) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping getImsiForApp "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Check success returned while getting imsi for 3GPP and 3GPP2 apps only
@@ -670,6 +796,13 @@
* Test IRadioSim.iccIoForApp() for the response returned.
*/
TEST_P(RadioSimTest, iccIoForApp) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping iccIoForApp "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
@@ -695,6 +828,13 @@
* Test IRadioSim.iccTransmitApduBasicChannel() for the response returned.
*/
TEST_P(RadioSimTest, iccTransmitApduBasicChannel) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping iccTransmitApduBasicChannel "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
SimApdu msg;
memset(&msg, 0, sizeof(msg));
@@ -710,6 +850,13 @@
* Test IRadioSim.iccOpenLogicalChannel() for the response returned.
*/
TEST_P(RadioSimTest, iccOpenLogicalChannel) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping iccOpenLogicalChannel "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
int p2 = 0x04;
// Specified in ISO 7816-4 clause 7.1.1 0x04 means that FCP template is requested.
@@ -725,6 +872,13 @@
* Test IRadioSim.iccCloseLogicalChannel() for the response returned.
*/
TEST_P(RadioSimTest, iccCloseLogicalChannel) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping iccCloseLogicalChannel "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Try closing invalid channel and check INVALID_ARGUMENTS returned as error
radio_sim->iccCloseLogicalChannel(serial, 0);
@@ -739,6 +893,13 @@
* Test IRadioSim.iccCloseLogicalChannelWithSessionInfo() for the response returned.
*/
TEST_P(RadioSimTest, iccCloseLogicalChannelWithSessionInfo) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping iccCloseLogicalChannelWithSessionInfo "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
int32_t aidl_version;
ndk::ScopedAStatus aidl_status = radio_sim->getInterfaceVersion(&aidl_version);
ASSERT_OK(aidl_status);
@@ -766,6 +927,13 @@
* Test IRadioSim.iccTransmitApduLogicalChannel() for the response returned.
*/
TEST_P(RadioSimTest, iccTransmitApduLogicalChannel) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping iccTransmitApduLogicalChannel "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
SimApdu msg;
memset(&msg, 0, sizeof(msg));
@@ -781,6 +949,13 @@
* Test IRadioSim.requestIccSimAuthentication() for the response returned.
*/
TEST_P(RadioSimTest, requestIccSimAuthentication) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping requestIccSimAuthentication "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Pass wrong challenge string and check RadioError::INVALID_ARGUMENTS
@@ -801,6 +976,13 @@
* Test IRadioSim.getFacilityLockForApp() for the response returned.
*/
TEST_P(RadioSimTest, getFacilityLockForApp) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping getFacilityLockForApp "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
std::string facility = "";
std::string password = "";
@@ -824,6 +1006,13 @@
* Test IRadioSim.setFacilityLockForApp() for the response returned.
*/
TEST_P(RadioSimTest, setFacilityLockForApp) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping setFacilityLockForApp "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
std::string facility = "";
bool lockState = false;
@@ -848,6 +1037,13 @@
* Test IRadioSim.getCdmaSubscription() for the response returned.
*/
TEST_P(RadioSimTest, getCdmaSubscription) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ GTEST_SKIP() << "Skipping getCdmaSubscription "
+ "due to undefined FEATURE_TELEPHONY_CDMA";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_sim->getCdmaSubscription(serial);
@@ -866,6 +1062,13 @@
* Test IRadioSim.getCdmaSubscriptionSource() for the response returned.
*/
TEST_P(RadioSimTest, getCdmaSubscriptionSource) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ GTEST_SKIP() << "Skipping getCdmaSubscriptionSource "
+ "due to undefined FEATURE_TELEPHONY_CDMA";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_sim->getCdmaSubscriptionSource(serial);
@@ -884,6 +1087,13 @@
* Test IRadioSim.setCdmaSubscriptionSource() for the response returned.
*/
TEST_P(RadioSimTest, setCdmaSubscriptionSource) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ GTEST_SKIP() << "Skipping setCdmaSubscriptionSource "
+ "due to undefined FEATURE_TELEPHONY_CDMA";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_sim->setCdmaSubscriptionSource(serial, CdmaSubscriptionSource::RUIM_SIM);
@@ -903,6 +1113,13 @@
* Test IRadioSim.setUiccSubscription() for the response returned.
*/
TEST_P(RadioSimTest, setUiccSubscription) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping setUiccSubscription "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
SelectUiccSub item;
memset(&item, 0, sizeof(item));
@@ -925,6 +1142,13 @@
* Test IRadioSim.sendEnvelope() for the response returned.
*/
TEST_P(RadioSimTest, sendEnvelope) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping sendEnvelope "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Test with sending empty string
@@ -948,6 +1172,13 @@
* Test IRadioSim.sendTerminalResponseToSim() for the response returned.
*/
TEST_P(RadioSimTest, sendTerminalResponseToSim) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping sendTerminalResponseToSim "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Test with sending empty string
@@ -971,6 +1202,13 @@
* Test IRadioSim.reportStkServiceIsRunning() for the response returned.
*/
TEST_P(RadioSimTest, reportStkServiceIsRunning) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping reportStkServiceIsRunning "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_sim->reportStkServiceIsRunning(serial);
@@ -990,6 +1228,13 @@
* string.
*/
TEST_P(RadioSimTest, sendEnvelopeWithStatus) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping sendEnvelopeWithStatus "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Test with sending empty string
diff --git a/radio/aidl/vts/radio_voice_test.cpp b/radio/aidl/vts/radio_voice_test.cpp
index 397c417..6c68fd5 100644
--- a/radio/aidl/vts/radio_voice_test.cpp
+++ b/radio/aidl/vts/radio_voice_test.cpp
@@ -93,15 +93,22 @@
* Test IRadioVoice.emergencyDial() for the response returned.
*/
TEST_P(RadioVoiceTest, emergencyDial) {
- if (!deviceSupportsFeature(FEATURE_VOICE_CALL)) {
- ALOGI("Skipping emergencyDial because voice call is not supported in device");
- return;
- } else if (!deviceSupportsFeature(FEATURE_TELEPHONY_GSM) &&
- !deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
- ALOGI("Skipping emergencyDial because gsm/cdma radio is not supported in device");
- return;
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping emergencyDial "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
} else {
- ALOGI("Running emergencyDial because voice call is supported in device");
+ if (!deviceSupportsFeature(FEATURE_VOICE_CALL)) {
+ ALOGI("Skipping emergencyDial because voice call is not supported in device");
+ return;
+ } else if (!deviceSupportsFeature(FEATURE_TELEPHONY_GSM) &&
+ !deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ ALOGI("Skipping emergencyDial because gsm/cdma radio is not supported in device");
+ return;
+ } else {
+ ALOGI("Running emergencyDial because voice call is supported in device");
+ }
}
serial = GetRandomSerialNumber();
@@ -147,15 +154,22 @@
* Test IRadioVoice.emergencyDial() with specified service and its response returned.
*/
TEST_P(RadioVoiceTest, emergencyDial_withServices) {
- if (!deviceSupportsFeature(FEATURE_VOICE_CALL)) {
- ALOGI("Skipping emergencyDial because voice call is not supported in device");
- return;
- } else if (!deviceSupportsFeature(FEATURE_TELEPHONY_GSM) &&
- !deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
- ALOGI("Skipping emergencyDial because gsm/cdma radio is not supported in device");
- return;
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping emergencyDial_withServices "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
} else {
- ALOGI("Running emergencyDial because voice call is supported in device");
+ if (!deviceSupportsFeature(FEATURE_VOICE_CALL)) {
+ ALOGI("Skipping emergencyDial because voice call is not supported in device");
+ return;
+ } else if (!deviceSupportsFeature(FEATURE_TELEPHONY_GSM) &&
+ !deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ ALOGI("Skipping emergencyDial because gsm/cdma radio is not supported in device");
+ return;
+ } else {
+ ALOGI("Running emergencyDial because voice call is supported in device");
+ }
}
serial = GetRandomSerialNumber();
@@ -201,15 +215,22 @@
* Test IRadioVoice.emergencyDial() with known emergency call routing and its response returned.
*/
TEST_P(RadioVoiceTest, emergencyDial_withEmergencyRouting) {
- if (!deviceSupportsFeature(FEATURE_VOICE_CALL)) {
- ALOGI("Skipping emergencyDial because voice call is not supported in device");
- return;
- } else if (!deviceSupportsFeature(FEATURE_TELEPHONY_GSM) &&
- !deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
- ALOGI("Skipping emergencyDial because gsm/cdma radio is not supported in device");
- return;
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping emergencyDial_withEmergencyRouting "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
} else {
- ALOGI("Running emergencyDial because voice call is supported in device");
+ if (!deviceSupportsFeature(FEATURE_VOICE_CALL)) {
+ ALOGI("Skipping emergencyDial because voice call is not supported in device");
+ return;
+ } else if (!deviceSupportsFeature(FEATURE_TELEPHONY_GSM) &&
+ !deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ ALOGI("Skipping emergencyDial because gsm/cdma radio is not supported in device");
+ return;
+ } else {
+ ALOGI("Running emergencyDial because voice call is supported in device");
+ }
}
serial = GetRandomSerialNumber();
@@ -256,6 +277,13 @@
* Test IRadioVoice.getCurrentCalls() for the response returned.
*/
TEST_P(RadioVoiceTest, getCurrentCalls) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping getCurrentCalls "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->getCurrentCalls(serial);
EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -268,6 +296,13 @@
* Test IRadioVoice.getClir() for the response returned.
*/
TEST_P(RadioVoiceTest, getClir) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping getClir "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->getClir(serial);
@@ -286,6 +321,13 @@
* Test IRadioVoice.setClir() for the response returned.
*/
TEST_P(RadioVoiceTest, setClir) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping setClir "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
int32_t status = 1;
@@ -304,6 +346,13 @@
* Test IRadioVoice.getClip() for the response returned.
*/
TEST_P(RadioVoiceTest, getClip) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping getClip "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->getClip(serial);
@@ -322,6 +371,13 @@
* Test IRadioVoice.getTtyMode() for the response returned.
*/
TEST_P(RadioVoiceTest, getTtyMode) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping getTtyMode "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->getTtyMode(serial);
@@ -338,6 +394,13 @@
* Test IRadioVoice.setTtyMode() for the response returned.
*/
TEST_P(RadioVoiceTest, setTtyMode) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping setTtyMode "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->setTtyMode(serial, TtyMode::OFF);
@@ -354,6 +417,13 @@
* Test IRadioVoice.setPreferredVoicePrivacy() for the response returned.
*/
TEST_P(RadioVoiceTest, setPreferredVoicePrivacy) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping setPreferredVoicePrivacy "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->setPreferredVoicePrivacy(serial, true);
@@ -371,6 +441,13 @@
* Test IRadioVoice.getPreferredVoicePrivacy() for the response returned.
*/
TEST_P(RadioVoiceTest, getPreferredVoicePrivacy) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping getPreferredVoicePrivacy "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->getPreferredVoicePrivacy(serial);
@@ -388,6 +465,13 @@
* Test IRadioVoice.exitEmergencyCallbackMode() for the response returned.
*/
TEST_P(RadioVoiceTest, exitEmergencyCallbackMode) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping exitEmergencyCallbackMode "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->exitEmergencyCallbackMode(serial);
@@ -406,6 +490,13 @@
* Test IRadioVoice.handleStkCallSetupRequestFromSim() for the response returned.
*/
TEST_P(RadioVoiceTest, handleStkCallSetupRequestFromSim) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping handleStkCallSetupRequestFromSim "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
bool accept = false;
@@ -427,6 +518,13 @@
* Test IRadioVoice.dial() for the response returned.
*/
TEST_P(RadioVoiceTest, dial) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping dial "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
Dial dialInfo;
@@ -454,6 +552,13 @@
* Test IRadioVoice.hangup() for the response returned.
*/
TEST_P(RadioVoiceTest, hangup) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping hangup "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->hangup(serial, 1);
@@ -473,6 +578,13 @@
* Test IRadioVoice.hangupWaitingOrBackground() for the response returned.
*/
TEST_P(RadioVoiceTest, hangupWaitingOrBackground) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping hangupWaitingOrBackground "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->hangupWaitingOrBackground(serial);
@@ -491,6 +603,13 @@
* Test IRadioVoice.hangupForegroundResumeBackground() for the response returned.
*/
TEST_P(RadioVoiceTest, hangupForegroundResumeBackground) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping hangupForegroundResumeBackground "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->hangupForegroundResumeBackground(serial);
@@ -509,6 +628,13 @@
* Test IRadioVoice.switchWaitingOrHoldingAndActive() for the response returned.
*/
TEST_P(RadioVoiceTest, switchWaitingOrHoldingAndActive) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping switchWaitingOrHoldingAndActive "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->switchWaitingOrHoldingAndActive(serial);
@@ -527,6 +653,13 @@
* Test IRadioVoice.conference() for the response returned.
*/
TEST_P(RadioVoiceTest, conference) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping conference "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->conference(serial);
@@ -545,6 +678,13 @@
* Test IRadioVoice.rejectCall() for the response returned.
*/
TEST_P(RadioVoiceTest, rejectCall) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping rejectCall "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->rejectCall(serial);
@@ -563,6 +703,13 @@
* Test IRadioVoice.getLastCallFailCause() for the response returned.
*/
TEST_P(RadioVoiceTest, getLastCallFailCause) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping getLastCallFailCause "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->getLastCallFailCause(serial);
@@ -580,6 +727,13 @@
* Test IRadioVoice.getCallForwardStatus() for the response returned.
*/
TEST_P(RadioVoiceTest, getCallForwardStatus) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping getCallForwardStatus "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
CallForwardInfo callInfo;
memset(&callInfo, 0, sizeof(callInfo));
@@ -602,6 +756,13 @@
* Test IRadioVoice.setCallForward() for the response returned.
*/
TEST_P(RadioVoiceTest, setCallForward) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping setCallForward "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
CallForwardInfo callInfo;
memset(&callInfo, 0, sizeof(callInfo));
@@ -624,6 +785,13 @@
* Test IRadioVoice.getCallWaiting() for the response returned.
*/
TEST_P(RadioVoiceTest, getCallWaiting) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping getCallWaiting "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->getCallWaiting(serial, 1);
@@ -643,6 +811,13 @@
* Test IRadioVoice.setCallWaiting() for the response returned.
*/
TEST_P(RadioVoiceTest, setCallWaiting) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping setCallWaiting "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->setCallWaiting(serial, true, 1);
@@ -662,6 +837,13 @@
* Test IRadioVoice.acceptCall() for the response returned.
*/
TEST_P(RadioVoiceTest, acceptCall) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping acceptCall "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->acceptCall(serial);
@@ -680,6 +862,13 @@
* Test IRadioVoice.separateConnection() for the response returned.
*/
TEST_P(RadioVoiceTest, separateConnection) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping separateConnection "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->separateConnection(serial, 1);
@@ -699,6 +888,13 @@
* Test IRadioVoice.explicitCallTransfer() for the response returned.
*/
TEST_P(RadioVoiceTest, explicitCallTransfer) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping explicitCallTransfer "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->explicitCallTransfer(serial);
@@ -717,6 +913,13 @@
* Test IRadioVoice.sendCdmaFeatureCode() for the response returned.
*/
TEST_P(RadioVoiceTest, sendCdmaFeatureCode) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ GTEST_SKIP() << "Skipping sendCdmaFeatureCode "
+ "due to undefined FEATURE_TELEPHONY_CDMA";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->sendCdmaFeatureCode(serial, std::string());
@@ -737,6 +940,13 @@
* Test IRadioVoice.sendDtmf() for the response returned.
*/
TEST_P(RadioVoiceTest, sendDtmf) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping sendDtmf "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->sendDtmf(serial, "1");
@@ -757,6 +967,13 @@
* Test IRadioVoice.startDtmf() for the response returned.
*/
TEST_P(RadioVoiceTest, startDtmf) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping startDtmf "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->startDtmf(serial, "1");
@@ -777,6 +994,13 @@
* Test IRadioVoice.stopDtmf() for the response returned.
*/
TEST_P(RadioVoiceTest, stopDtmf) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping stopDtmf "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->stopDtmf(serial);
@@ -796,6 +1020,13 @@
* Test IRadioVoice.setMute() for the response returned.
*/
TEST_P(RadioVoiceTest, setMute) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping setMute "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->setMute(serial, true);
@@ -814,6 +1045,13 @@
* Test IRadioVoice.getMute() for the response returned.
*/
TEST_P(RadioVoiceTest, getMute) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping getMute "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->getMute(serial);
@@ -830,6 +1068,13 @@
* Test IRadioVoice.sendBurstDtmf() for the response returned.
*/
TEST_P(RadioVoiceTest, sendBurstDtmf) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping sendBurstDtmf "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->sendBurstDtmf(serial, "1", 0, 0);
@@ -849,6 +1094,13 @@
* Test IRadioVoice.sendUssd() for the response returned.
*/
TEST_P(RadioVoiceTest, sendUssd) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping sendUssd "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->sendUssd(serial, std::string("test"));
EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -867,6 +1119,13 @@
* Test IRadioVoice.cancelPendingUssd() for the response returned.
*/
TEST_P(RadioVoiceTest, cancelPendingUssd) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping cancelPendingUssd "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->cancelPendingUssd(serial);
@@ -886,6 +1145,13 @@
* Test IRadioVoice.isVoNrEnabled() for the response returned.
*/
TEST_P(RadioVoiceTest, isVoNrEnabled) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_IMS)) {
+ GTEST_SKIP() << "Skipping isVoNrEnabled "
+ "due to undefined FEATURE_TELEPHONY_IMS";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->isVoNrEnabled(serial);
@@ -901,6 +1167,13 @@
* Test IRadioVoice.setVoNrEnabled() for the response returned.
*/
TEST_P(RadioVoiceTest, setVoNrEnabled) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_IMS)) {
+ GTEST_SKIP() << "Skipping setVoNrEnabled "
+ "due to undefined FEATURE_TELEPHONY_IMS";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->setVoNrEnabled(serial, true);
diff --git a/security/authgraph/aidl/vts/functional/lib.rs b/security/authgraph/aidl/vts/functional/lib.rs
index 7b9b2b9..da3fa1c 100644
--- a/security/authgraph/aidl/vts/functional/lib.rs
+++ b/security/authgraph/aidl/vts/functional/lib.rs
@@ -24,22 +24,19 @@
PlainPubKey::PlainPubKey, PubKey::PubKey, SessionIdSignature::SessionIdSignature,
};
use authgraph_boringssl as boring;
-use authgraph_core::keyexchange as ke;
-use authgraph_core::{arc, key, traits};
-use authgraph_nonsecure::StdClock;
+use authgraph_core::{error::Error as AgError, keyexchange as ke};
use coset::CborSerializable;
pub mod sink;
pub mod source;
-/// Return a collection of AuthGraph trait implementations suitable for testing.
-pub fn test_impls() -> traits::TraitImpl {
- // Note that the local implementation is using a clock with a potentially different epoch than
- // the implementation under test.
- boring::trait_impls(
+/// Return an AuthGraphParticipant suitable for testing.
+pub fn test_ag_participant() -> Result<ke::AuthGraphParticipant, AgError> {
+ Ok(ke::AuthGraphParticipant::new(
+ boring::crypto_trait_impls(),
Box::<boring::test_device::AgDevice>::default(),
- Some(Box::new(StdClock::default())),
- )
+ ke::MAX_OPENED_SESSIONS,
+ )?)
}
fn build_plain_pub_key(pub_key: &Option<Vec<u8>>) -> PubKey {
@@ -56,14 +53,6 @@
}
}
-fn verification_key_from_identity(impls: &traits::TraitImpl, identity: &[u8]) -> key::EcVerifyKey {
- let identity = key::Identity::from_slice(identity).expect("invalid identity CBOR");
- impls
- .device
- .process_peer_cert_chain(&identity.cert_chain, &*impls.ecdsa)
- .expect("failed to extract signing key")
-}
-
fn vec_to_identity(data: &[u8]) -> Identity {
Identity {
identity: data.to_vec(),
@@ -75,26 +64,3 @@
signature: data.to_vec(),
}
}
-
-/// Decrypt a pair of AES-256 keys encrypted with the AuthGraph PBK.
-pub fn decipher_aes_keys(imp: &traits::TraitImpl, arc: &[Vec<u8>; 2]) -> [key::AesKey; 2] {
- [
- decipher_aes_key(imp, &arc[0]),
- decipher_aes_key(imp, &arc[1]),
- ]
-}
-
-/// Decrypt an AES-256 key encrypted with the AuthGraph PBK.
-pub fn decipher_aes_key(imp: &traits::TraitImpl, arc: &[u8]) -> key::AesKey {
- let pbk = imp.device.get_per_boot_key().expect("no PBK available");
- let arc::ArcContent {
- payload,
- protected_headers: _,
- unprotected_headers: _,
- } = arc::decipher_arc(&pbk, arc, &*imp.aes_gcm).expect("failed to decrypt arc");
- assert_eq!(payload.0.len(), 32);
- let mut key = key::AesKey([0; 32]);
- key.0.copy_from_slice(&payload.0);
- assert_ne!(key.0, [0; 32], "agreed AES-256 key should be non-zero");
- key
-}
diff --git a/security/authgraph/aidl/vts/functional/role_test.rs b/security/authgraph/aidl/vts/functional/role_test.rs
index e95361a..71a2fae 100644
--- a/security/authgraph/aidl/vts/functional/role_test.rs
+++ b/security/authgraph/aidl/vts/functional/role_test.rs
@@ -48,31 +48,31 @@
#[test]
fn test_nonsecure_source_mainline() {
- let mut impls = vts::test_impls();
- vts::source::test_mainline(&mut impls, require_nonsecure!());
+ let mut sink = vts::test_ag_participant().expect("failed to create a local sink");
+ vts::source::test_mainline(&mut sink, require_nonsecure!());
}
#[test]
fn test_nonsecure_source_corrupt_sig() {
- let mut impls = vts::test_impls();
- vts::source::test_corrupt_sig(&mut impls, require_nonsecure!());
+ let mut sink = vts::test_ag_participant().expect("failed to create a local sink");
+ vts::source::test_corrupt_sig(&mut sink, require_nonsecure!());
}
#[test]
fn test_nonsecure_source_corrupt_keys() {
- let mut impls = vts::test_impls();
- vts::source::test_corrupt_key(&mut impls, require_nonsecure!());
+ let mut sink = vts::test_ag_participant().expect("failed to create a local sink");
+ vts::source::test_corrupt_key(&mut sink, require_nonsecure!());
}
#[test]
fn test_nonsecure_sink_mainline() {
- let mut impls = vts::test_impls();
- vts::sink::test_mainline(&mut impls, require_nonsecure!());
+ let mut source = vts::test_ag_participant().expect("failed to create a local source");
+ vts::sink::test_mainline(&mut source, require_nonsecure!());
}
#[test]
fn test_nonsecure_sink_corrupt_sig() {
- let mut impls = vts::test_impls();
- vts::sink::test_corrupt_sig(&mut impls, require_nonsecure!());
+ let mut source = vts::test_ag_participant().expect("failed to create a local source");
+ vts::sink::test_corrupt_sig(&mut source, require_nonsecure!());
}
#[test]
fn test_nonsecure_sink_corrupt_keys() {
- let mut impls = vts::test_impls();
- vts::sink::test_corrupt_keys(&mut impls, require_nonsecure!());
+ let mut source = vts::test_ag_participant().expect("failed to create a local source");
+ vts::sink::test_corrupt_keys(&mut source, require_nonsecure!());
}
diff --git a/security/authgraph/aidl/vts/functional/sink.rs b/security/authgraph/aidl/vts/functional/sink.rs
index 5c81593..bb357b8 100644
--- a/security/authgraph/aidl/vts/functional/sink.rs
+++ b/security/authgraph/aidl/vts/functional/sink.rs
@@ -16,23 +16,28 @@
//! VTS tests for sinks
use super::*;
-use authgraph_core::traits;
+use authgraph_core::{key, keyexchange as ke};
/// Run AuthGraph tests against the provided sink, using a local test source implementation.
-pub fn test(impls: &mut traits::TraitImpl, sink: binder::Strong<dyn IAuthGraphKeyExchange>) {
- test_mainline(impls, sink.clone());
- test_corrupt_sig(impls, sink.clone());
- test_corrupt_keys(impls, sink);
+pub fn test(
+ local_source: &mut ke::AuthGraphParticipant,
+ sink: binder::Strong<dyn IAuthGraphKeyExchange>,
+) {
+ test_mainline(local_source, sink.clone());
+ test_corrupt_sig(local_source, sink.clone());
+ test_corrupt_keys(local_source, sink);
}
/// Perform mainline AuthGraph key exchange with the provided sink and local implementation.
/// Return the agreed AES keys in plaintext.
pub fn test_mainline(
- impls: &mut traits::TraitImpl,
+ local_source: &mut ke::AuthGraphParticipant,
sink: binder::Strong<dyn IAuthGraphKeyExchange>,
) -> [key::AesKey; 2] {
// Step 1: create an ephemeral ECDH key at the (local) source.
- let source_init_info = ke::create(impls).expect("failed to create() with local impl");
+ let source_init_info = local_source
+ .create()
+ .expect("failed to create() with local impl");
// Step 2: pass the source's ECDH public key and other session info to the (remote) sink.
let init_result = sink
@@ -50,40 +55,43 @@
assert!(!sink_info.sessionId.is_empty());
// The AuthGraph core library will verify the session ID signature, but do it here too.
- let sink_verification_key =
- verification_key_from_identity(&impls, &sink_init_info.identity.identity);
- ke::verify_signature_on_session_id(
- &sink_verification_key,
- &sink_info.sessionId,
- &sink_info.signature.signature,
- &*impls.ecdsa,
- )
- .expect("failed verification of signed session ID");
+ let sink_verification_key = local_source
+ .peer_verification_key_from_identity(&sink_init_info.identity.identity)
+ .expect("failed to get peer verification from identity");
+ local_source
+ .verify_signature_on_session_id(
+ &sink_verification_key,
+ &sink_info.sessionId,
+ &sink_info.signature.signature,
+ )
+ .expect("failed verification of signed session ID");
// Step 3: pass the sink's ECDH public key and other session info to the (local) source, so it
// can calculate the same pair of symmetric keys.
- let source_info = ke::finish(
- impls,
- &sink_pub_key.plainPubKey,
- &sink_init_info.identity.identity,
- &sink_info.signature.signature,
- &sink_init_info.nonce,
- sink_init_info.version,
- source_init_info.ke_key,
- )
- .expect("failed to finish() with local impl");
+ let source_info = local_source
+ .finish(
+ &sink_pub_key.plainPubKey,
+ &sink_init_info.identity.identity,
+ &sink_info.signature.signature,
+ &sink_init_info.nonce,
+ sink_init_info.version,
+ source_init_info.ke_key,
+ )
+ .expect("failed to finish() with local impl");
assert!(!source_info.session_id.is_empty());
// The AuthGraph core library will verify the session ID signature, but do it here too.
- let source_verification_key =
- verification_key_from_identity(&impls, &source_init_info.identity);
- ke::verify_signature_on_session_id(
- &source_verification_key,
- &source_info.session_id,
- &source_info.session_id_signature,
- &*impls.ecdsa,
- )
- .expect("failed verification of signed session ID");
+ let source_verification_key = key::Identity::from_slice(&source_init_info.identity)
+ .expect("invalid identity CBOR")
+ .cert_chain
+ .root_key;
+ local_source
+ .verify_signature_on_session_id(
+ &source_verification_key,
+ &source_info.session_id,
+ &source_info.session_id_signature,
+ )
+ .expect("failed verification of signed session ID");
// Both ends should agree on the session ID.
assert_eq!(source_info.session_id, sink_info.sessionId);
@@ -96,19 +104,28 @@
&sink_info.sharedKeys,
)
.expect("failed to authenticationComplete() with remote sink");
-
// Decrypt and return the session keys.
- decipher_aes_keys(&impls, &source_info.shared_keys)
+ let decrypted_shared_keys = local_source
+ .decipher_shared_keys_from_arcs(&source_info.shared_keys)
+ .expect("failed to decrypt shared key arcs")
+ .try_into();
+ let decrypted_shared_keys_array = match decrypted_shared_keys {
+ Ok(array) => array,
+ Err(_) => panic!("wrong number of decrypted shared key arcs"),
+ };
+ decrypted_shared_keys_array
}
/// Perform mainline AuthGraph key exchange with the provided sink, but provide an invalid
/// session ID signature.
pub fn test_corrupt_sig(
- impls: &mut traits::TraitImpl,
+ local_source: &mut ke::AuthGraphParticipant,
sink: binder::Strong<dyn IAuthGraphKeyExchange>,
) {
// Step 1: create an ephemeral ECDH key at the (local) source.
- let source_init_info = ke::create(impls).expect("failed to create() with local impl");
+ let source_init_info = local_source
+ .create()
+ .expect("failed to create() with local impl");
// Step 2: pass the source's ECDH public key and other session info to the (remote) sink.
let init_result = sink
@@ -127,16 +144,16 @@
// Step 3: pass the sink's ECDH public key and other session info to the (local) source, so it
// can calculate the same pair of symmetric keys.
- let source_info = ke::finish(
- impls,
- &sink_pub_key.plainPubKey,
- &sink_init_info.identity.identity,
- &sink_info.signature.signature,
- &sink_init_info.nonce,
- sink_init_info.version,
- source_init_info.ke_key,
- )
- .expect("failed to finish() with local impl");
+ let source_info = local_source
+ .finish(
+ &sink_pub_key.plainPubKey,
+ &sink_init_info.identity.identity,
+ &sink_info.signature.signature,
+ &sink_init_info.nonce,
+ sink_init_info.version,
+ source_init_info.ke_key,
+ )
+ .expect("failed to finish() with local impl");
assert!(!source_info.session_id.is_empty());
// Build a corrupted version of the (local) source's session ID signature.
@@ -158,11 +175,13 @@
/// Perform mainline AuthGraph key exchange with the provided sink, but provide an invalid
/// Arc for the sink's key.
pub fn test_corrupt_keys(
- impls: &mut traits::TraitImpl,
+ local_source: &mut ke::AuthGraphParticipant,
sink: binder::Strong<dyn IAuthGraphKeyExchange>,
) {
// Step 1: create an ephemeral ECDH key at the (local) source.
- let source_init_info = ke::create(impls).expect("failed to create() with local impl");
+ let source_init_info = local_source
+ .create()
+ .expect("failed to create() with local impl");
// Step 2: pass the source's ECDH public key and other session info to the (remote) sink.
let init_result = sink
@@ -181,16 +200,16 @@
// Step 3: pass the sink's ECDH public key and other session info to the (local) source, so it
// can calculate the same pair of symmetric keys.
- let source_info = ke::finish(
- impls,
- &sink_pub_key.plainPubKey,
- &sink_init_info.identity.identity,
- &sink_info.signature.signature,
- &sink_init_info.nonce,
- sink_init_info.version,
- source_init_info.ke_key,
- )
- .expect("failed to finish() with local impl");
+ let source_info = local_source
+ .finish(
+ &sink_pub_key.plainPubKey,
+ &sink_init_info.identity.identity,
+ &sink_info.signature.signature,
+ &sink_init_info.nonce,
+ sink_init_info.version,
+ source_init_info.ke_key,
+ )
+ .expect("failed to finish() with local impl");
assert!(!source_info.session_id.is_empty());
// Deliberately corrupt the sink's shared key Arcs before returning them
diff --git a/security/authgraph/aidl/vts/functional/source.rs b/security/authgraph/aidl/vts/functional/source.rs
index 9aaaaee..4178a99 100644
--- a/security/authgraph/aidl/vts/functional/source.rs
+++ b/security/authgraph/aidl/vts/functional/source.rs
@@ -16,19 +16,22 @@
//! VTS tests for sources
use super::*;
-use authgraph_core::traits;
+use authgraph_core::{key, keyexchange as ke};
/// Run AuthGraph tests against the provided source, using a local test sink implementation.
-pub fn test(impls: &mut traits::TraitImpl, source: binder::Strong<dyn IAuthGraphKeyExchange>) {
- test_mainline(impls, source.clone());
- test_corrupt_sig(impls, source.clone());
- test_corrupt_key(impls, source);
+pub fn test(
+ local_sink: &mut ke::AuthGraphParticipant,
+ source: binder::Strong<dyn IAuthGraphKeyExchange>,
+) {
+ test_mainline(local_sink, source.clone());
+ test_corrupt_sig(local_sink, source.clone());
+ test_corrupt_key(local_sink, source);
}
/// Perform mainline AuthGraph key exchange with the provided source.
/// Return the agreed AES keys in plaintext.
pub fn test_mainline(
- impls: &mut traits::TraitImpl,
+ local_sink: &mut ke::AuthGraphParticipant,
source: binder::Strong<dyn IAuthGraphKeyExchange>,
) -> [key::AesKey; 2] {
// Step 1: create an ephemeral ECDH key at the (remote) source.
@@ -40,14 +43,14 @@
let source_pub_key = extract_plain_pub_key(&source_init_info.key.pubKey);
// Step 2: pass the source's ECDH public key and other session info to the (local) sink.
- let init_result = ke::init(
- impls,
- &source_pub_key.plainPubKey,
- &source_init_info.identity.identity,
- &source_init_info.nonce,
- source_init_info.version,
- )
- .expect("failed to init() with local impl");
+ let init_result = local_sink
+ .init(
+ &source_pub_key.plainPubKey,
+ &source_init_info.identity.identity,
+ &source_init_info.nonce,
+ source_init_info.version,
+ )
+ .expect("failed to init() with local impl");
let sink_init_info = init_result.session_init_info;
let sink_pub_key = sink_init_info
.ke_key
@@ -58,14 +61,17 @@
assert!(!sink_info.session_id.is_empty());
// The AuthGraph core library will verify the session ID signature, but do it here too.
- let sink_verification_key = verification_key_from_identity(&impls, &sink_init_info.identity);
- ke::verify_signature_on_session_id(
- &sink_verification_key,
- &sink_info.session_id,
- &sink_info.session_id_signature,
- &*impls.ecdsa,
- )
- .expect("failed verification of signed session ID");
+ let sink_verification_key = key::Identity::from_slice(&sink_init_info.identity)
+ .expect("invalid identity CBOR")
+ .cert_chain
+ .root_key;
+ local_sink
+ .verify_signature_on_session_id(
+ &sink_verification_key,
+ &sink_info.session_id,
+ &sink_info.session_id_signature,
+ )
+ .expect("failed verification of signed session ID");
// Step 3: pass the sink's ECDH public key and other session info to the (remote) source, so it
// can calculate the same pair of symmetric keys.
@@ -86,36 +92,41 @@
assert!(!source_info.sessionId.is_empty());
// The AuthGraph core library will verify the session ID signature, but do it here too.
- let source_verification_key =
- verification_key_from_identity(&impls, &source_init_info.identity.identity);
- ke::verify_signature_on_session_id(
- &source_verification_key,
- &source_info.sessionId,
- &source_info.signature.signature,
- &*impls.ecdsa,
- )
- .expect("failed verification of signed session ID");
+ let source_verification_key = local_sink
+ .peer_verification_key_from_identity(&source_init_info.identity.identity)
+ .expect("failed to get peer verification from identity");
+ local_sink
+ .verify_signature_on_session_id(
+ &source_verification_key,
+ &source_info.sessionId,
+ &source_info.signature.signature,
+ )
+ .expect("failed verification of signed session ID");
// Both ends should agree on the session ID.
assert_eq!(source_info.sessionId, sink_info.session_id);
// Step 4: pass the (remote) source's session ID signature back to the sink, so it can check it
// and update the symmetric keys so they're marked as authentication complete.
- let sink_arcs = ke::authentication_complete(
- impls,
- &source_info.signature.signature,
- sink_info.shared_keys,
- )
- .expect("failed to authenticationComplete() with local sink");
-
+ let sink_arcs = local_sink
+ .authentication_complete(&source_info.signature.signature, sink_info.shared_keys)
+ .expect("failed to authenticationComplete() with local sink");
// Decrypt and return the session keys.
- decipher_aes_keys(&impls, &sink_arcs)
+ let decrypted_shared_keys = local_sink
+ .decipher_shared_keys_from_arcs(&sink_arcs)
+ .expect("failed to decrypt shared key arcs")
+ .try_into();
+ let decrypted_shared_keys_array = match decrypted_shared_keys {
+ Ok(array) => array,
+ Err(_) => panic!("wrong number of decrypted shared key arcs"),
+ };
+ decrypted_shared_keys_array
}
/// Perform mainline AuthGraph key exchange with the provided source, but provide an invalid session
/// ID signature.
pub fn test_corrupt_sig(
- impls: &mut traits::TraitImpl,
+ local_sink: &mut ke::AuthGraphParticipant,
source: binder::Strong<dyn IAuthGraphKeyExchange>,
) {
// Step 1: create an ephemeral ECDH key at the (remote) source.
@@ -127,14 +138,14 @@
let source_pub_key = extract_plain_pub_key(&source_init_info.key.pubKey);
// Step 2: pass the source's ECDH public key and other session info to the (local) sink.
- let init_result = ke::init(
- impls,
- &source_pub_key.plainPubKey,
- &source_init_info.identity.identity,
- &source_init_info.nonce,
- source_init_info.version,
- )
- .expect("failed to init() with local impl");
+ let init_result = local_sink
+ .init(
+ &source_pub_key.plainPubKey,
+ &source_init_info.identity.identity,
+ &source_init_info.nonce,
+ source_init_info.version,
+ )
+ .expect("failed to init() with local impl");
let sink_init_info = init_result.session_init_info;
let sink_pub_key = sink_init_info
.ke_key
@@ -172,7 +183,7 @@
/// Perform mainline AuthGraph key exchange with the provided source, but give it back
/// a corrupted key.
pub fn test_corrupt_key(
- impls: &mut traits::TraitImpl,
+ local_sink: &mut ke::AuthGraphParticipant,
source: binder::Strong<dyn IAuthGraphKeyExchange>,
) {
// Step 1: create an ephemeral ECDH key at the (remote) source.
@@ -184,14 +195,14 @@
let source_pub_key = extract_plain_pub_key(&source_init_info.key.pubKey);
// Step 2: pass the source's ECDH public key and other session info to the (local) sink.
- let init_result = ke::init(
- impls,
- &source_pub_key.plainPubKey,
- &source_init_info.identity.identity,
- &source_init_info.nonce,
- source_init_info.version,
- )
- .expect("failed to init() with local impl");
+ let init_result = local_sink
+ .init(
+ &source_pub_key.plainPubKey,
+ &source_init_info.identity.identity,
+ &source_init_info.nonce,
+ source_init_info.version,
+ )
+ .expect("failed to init() with local impl");
let sink_init_info = init_result.session_init_info;
let sink_pub_key = sink_init_info
.ke_key
@@ -202,14 +213,17 @@
assert!(!sink_info.session_id.is_empty());
// The AuthGraph core library will verify the session ID signature, but do it here too.
- let sink_verification_key = verification_key_from_identity(&impls, &sink_init_info.identity);
- ke::verify_signature_on_session_id(
- &sink_verification_key,
- &sink_info.session_id,
- &sink_info.session_id_signature,
- &*impls.ecdsa,
- )
- .expect("failed verification of signed session ID");
+ let sink_verification_key = key::Identity::from_slice(&sink_init_info.identity)
+ .expect("invalid identity CBOR")
+ .cert_chain
+ .root_key;
+ local_sink
+ .verify_signature_on_session_id(
+ &sink_verification_key,
+ &sink_info.session_id,
+ &sink_info.session_id_signature,
+ )
+ .expect("failed verification of signed session ID");
// Deliberately corrupt the source's encrypted key.
let mut corrupt_key = source_init_info.key.clone();
diff --git a/security/authgraph/default/src/fuzzer.rs b/security/authgraph/default/src/fuzzer.rs
index 6a9cfdd..d401777 100644
--- a/security/authgraph/default/src/fuzzer.rs
+++ b/security/authgraph/default/src/fuzzer.rs
@@ -25,7 +25,7 @@
use std::sync::{Arc, Mutex};
fuzz_target!(|data: &[u8]| {
- let local_ta = LocalTa::new();
+ let local_ta = LocalTa::new().expect("Failed to create an AuthGraph local TA.");
let service = AuthGraphService::new_as_binder(Arc::new(Mutex::new(local_ta)));
fuzz_service(&mut service.as_binder(), data);
});
diff --git a/security/authgraph/default/src/lib.rs b/security/authgraph/default/src/lib.rs
index 4cd0cb7..43d037c 100644
--- a/security/authgraph/default/src/lib.rs
+++ b/security/authgraph/default/src/lib.rs
@@ -18,7 +18,9 @@
use authgraph_boringssl as boring;
use authgraph_core::{
+ error,
key::MillisecondsSinceEpoch,
+ keyexchange,
ta::{AuthGraphTa, Role},
traits,
};
@@ -57,16 +59,17 @@
impl LocalTa {
/// Create a new instance.
- pub fn new() -> Self {
- Self {
+ pub fn new() -> Result<Self, error::Error> {
+ Ok(Self {
ta: Arc::new(Mutex::new(AuthGraphTa::new(
- boring::trait_impls(
+ keyexchange::AuthGraphParticipant::new(
+ boring::crypto_trait_impls(),
Box::<boring::test_device::AgDevice>::default(),
- Some(Box::new(StdClock::default())),
- ),
+ keyexchange::MAX_OPENED_SESSIONS,
+ )?,
Role::Both,
))),
- }
+ })
}
}
diff --git a/security/authgraph/default/src/main.rs b/security/authgraph/default/src/main.rs
index 873eb4e..81f2dd6 100644
--- a/security/authgraph/default/src/main.rs
+++ b/security/authgraph/default/src/main.rs
@@ -65,7 +65,8 @@
binder::ProcessState::start_thread_pool();
// Register the service
- let local_ta = LocalTa::new();
+ let local_ta =
+ LocalTa::new().map_err(|e| format!("Failed to create the TA because: {e:?}"))?;
let service = service::AuthGraphService::new_as_binder(Arc::new(Mutex::new(local_ta)));
let service_name = format!("{}/{}", SERVICE_NAME, SERVICE_INSTANCE);
binder::add_service(&service_name, service.as_binder()).map_err(|e| {
diff --git a/tests/multithread/1.0/default/Multithread.h b/tests/multithread/1.0/default/Multithread.h
index 0d4a007..7df75cc 100644
--- a/tests/multithread/1.0/default/Multithread.h
+++ b/tests/multithread/1.0/default/Multithread.h
@@ -33,7 +33,7 @@
std::condition_variable mCv;
std::mutex mCvMutex;
- static constexpr auto kTimeoutDuration = 100ms;
+ static constexpr auto kTimeoutDuration = 1000ms;
};
extern "C" IMultithread* HIDL_FETCH_IMultithread(const char* name);
diff --git a/tv/tuner/aidl/default/Demux.cpp b/tv/tuner/aidl/default/Demux.cpp
index 34e3442..de94467 100644
--- a/tv/tuner/aidl/default/Demux.cpp
+++ b/tv/tuner/aidl/default/Demux.cpp
@@ -53,6 +53,9 @@
Demux::~Demux() {
ALOGV("%s", __FUNCTION__);
+ if (mDemuxIptvReadThread.joinable()) {
+ mDemuxIptvReadThread.join();
+ }
close();
}
@@ -114,16 +117,26 @@
}
}
-void Demux::readIptvThreadLoop(dtv_plugin* interface, dtv_streamer* streamer, void* buf,
- size_t buf_size, int timeout_ms, int buffer_timeout) {
+void Demux::setIptvThreadRunning(bool isIptvThreadRunning) {
+ std::unique_lock<std::mutex> lock(mIsIptvThreadRunningMutex);
+ mIsIptvReadThreadRunning = isIptvThreadRunning;
+ mIsIptvThreadRunningCv.notify_all();
+}
+
+void Demux::readIptvThreadLoop(dtv_plugin* interface, dtv_streamer* streamer, size_t buf_size,
+ int timeout_ms, int buffer_timeout) {
Timer *timer, *fullBufferTimer;
- while (mDemuxIptvReadThreadRunning) {
+ while (true) {
+ std::unique_lock<std::mutex> lock(mIsIptvThreadRunningMutex);
+ mIsIptvThreadRunningCv.wait(lock, [this] { return mIsIptvReadThreadRunning; });
if (mIsIptvDvrFMQFull && fullBufferTimer->get_elapsed_time_ms() > buffer_timeout) {
ALOGE("DVR FMQ has not been flushed within timeout of %d ms", buffer_timeout);
delete fullBufferTimer;
break;
}
timer = new Timer();
+ void* buf = malloc(sizeof(char) * IPTV_BUFFER_SIZE);
+ if (buf == nullptr) ALOGI("Buffer allocation failed");
ssize_t bytes_read = interface->read_stream(streamer, buf, buf_size, timeout_ms);
if (bytes_read == 0) {
double elapsed_time = timer->get_elapsed_time_ms();
@@ -157,8 +170,9 @@
default:
ALOGI("Invalid DVR Status");
}
+
+ free(buf);
}
- mDemuxIptvReadThreadRunning = false;
}
::ndk::ScopedAStatus Demux::setFrontendDataSource(int32_t in_frontendId) {
@@ -216,17 +230,8 @@
// while thread is alive, keep reading data
int timeout_ms = 20;
int buffer_timeout = 10000; // 10s
- void* buf = malloc(sizeof(char) * IPTV_BUFFER_SIZE);
- if (buf == nullptr) ALOGI("malloc buf failed");
- ALOGI("[ INFO ] Allocated buffer of size %d", IPTV_BUFFER_SIZE);
- ALOGI("Getting FMQ from DVR instance to write socket data");
- mDemuxIptvReadThreadRunning = true;
mDemuxIptvReadThread = std::thread(&Demux::readIptvThreadLoop, this, interface, streamer,
- buf, IPTV_BUFFER_SIZE, timeout_ms, buffer_timeout);
- if (mDemuxIptvReadThread.joinable()) {
- mDemuxIptvReadThread.join();
- }
- free(buf);
+ IPTV_BUFFER_SIZE, timeout_ms, buffer_timeout);
}
return ::ndk::ScopedAStatus::ok();
}
diff --git a/tv/tuner/aidl/default/Demux.h b/tv/tuner/aidl/default/Demux.h
index a23063f..ad7b7a7 100644
--- a/tv/tuner/aidl/default/Demux.h
+++ b/tv/tuner/aidl/default/Demux.h
@@ -103,7 +103,7 @@
void setIsRecording(bool isRecording);
bool isRecording();
void startFrontendInputLoop();
- void readIptvThreadLoop(dtv_plugin* interface, dtv_streamer* streamer, void* buf, size_t size,
+ void readIptvThreadLoop(dtv_plugin* interface, dtv_streamer* streamer, size_t size,
int timeout_ms, int buffer_timeout);
/**
@@ -124,6 +124,11 @@
void setInUse(bool inUse);
void setTunerService(std::shared_ptr<Tuner> tuner);
+ /**
+ * Setter for IPTV Reading thread
+ */
+ void setIptvThreadRunning(bool isIptvThreadRunning);
+
private:
// Tuner service
std::shared_ptr<Tuner> mTuner;
@@ -196,10 +201,16 @@
* If a specific filter's writing loop is still running
*/
std::atomic<bool> mFrontendInputThreadRunning;
- std::atomic<bool> mDemuxIptvReadThreadRunning;
std::atomic<bool> mKeepFetchingDataFromFrontend;
/**
+ * Controls IPTV reading thread status
+ */
+ bool mIsIptvReadThreadRunning;
+ std::mutex mIsIptvThreadRunningMutex;
+ std::condition_variable mIsIptvThreadRunningCv;
+
+ /**
* If the dvr recording is running.
*/
bool mIsRecording = false;
diff --git a/tv/tuner/aidl/default/Filter.cpp b/tv/tuner/aidl/default/Filter.cpp
index d8f5dd5..212d329 100644
--- a/tv/tuner/aidl/default/Filter.cpp
+++ b/tv/tuner/aidl/default/Filter.cpp
@@ -328,6 +328,8 @@
std::vector<DemuxFilterEvent> events;
mFilterCount += 1;
+ mDemux->setIptvThreadRunning(true);
+
// All the filter event callbacks in start are for testing purpose.
switch (mType.mainType) {
case DemuxFilterMainType::TS:
@@ -365,6 +367,9 @@
ALOGV("%s", __FUNCTION__);
mFilterCount -= 1;
+ if (mFilterCount == 0) {
+ mDemux->setIptvThreadRunning(false);
+ }
mFilterThreadRunning = false;
if (mFilterThread.joinable()) {
diff --git a/tv/tuner/aidl/default/Frontend.cpp b/tv/tuner/aidl/default/Frontend.cpp
index 6bdbac5..57ed1ba 100644
--- a/tv/tuner/aidl/default/Frontend.cpp
+++ b/tv/tuner/aidl/default/Frontend.cpp
@@ -34,6 +34,8 @@
mTuner = nullptr;
// Init callback to nullptr
mCallback = nullptr;
+ mIptvPluginInterface = nullptr;
+ mIptvPluginStreamer = nullptr;
switch (mType) {
case FrontendType::ISDBS: {
@@ -215,7 +217,7 @@
void Frontend::readTuneByte(dtv_streamer* streamer, void* buf, size_t buf_size, int timeout_ms) {
ssize_t bytes_read = mIptvPluginInterface->read_stream(streamer, buf, buf_size, timeout_ms);
- if (bytes_read == 0) {
+ if (bytes_read <= 0) {
ALOGI("[ ERROR ] Tune byte couldn't be read.");
return;
}
diff --git a/wifi/aidl/Android.bp b/wifi/aidl/Android.bp
index 7bc8ae7..ac95f85 100644
--- a/wifi/aidl/Android.bp
+++ b/wifi/aidl/Android.bp
@@ -27,6 +27,9 @@
srcs: [
"android/hardware/wifi/*.aidl",
],
+ imports: [
+ "android.hardware.wifi.common-V1",
+ ],
stability: "vintf",
backend: {
java: {
@@ -42,6 +45,9 @@
enabled: false,
},
},
+ cpp: {
+ enabled: false,
+ },
},
versions_with_info: [
{
@@ -49,6 +55,5 @@
imports: [],
},
],
- frozen: true,
-
+ frozen: false,
}
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 4ea2081..2d7fe03 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
@@ -83,6 +83,7 @@
void triggerSubsystemRestart();
void enableStaChannelForPeerNetwork(in int channelCategoryEnableFlag);
void setMloMode(in android.hardware.wifi.IWifiChip.ChipMloMode mode);
+ @PropagateAllowBlocking android.hardware.wifi.IWifiApIface createApOrBridgedApIface(in android.hardware.wifi.IfaceConcurrencyType iface, in android.hardware.wifi.common.OuiKeyedData[] vendorData);
const int NO_POWER_CAP_CONSTANT = 0x7FFFFFFF;
@Backing(type="int") @VintfStability
enum FeatureSetMask {
diff --git a/wifi/aidl/android/hardware/wifi/IWifiChip.aidl b/wifi/aidl/android/hardware/wifi/IWifiChip.aidl
index c1caa7e..733ff62 100644
--- a/wifi/aidl/android/hardware/wifi/IWifiChip.aidl
+++ b/wifi/aidl/android/hardware/wifi/IWifiChip.aidl
@@ -33,6 +33,7 @@
import android.hardware.wifi.WifiIfaceMode;
import android.hardware.wifi.WifiRadioCombination;
import android.hardware.wifi.WifiUsableChannel;
+import android.hardware.wifi.common.OuiKeyedData;
/**
* Interface that represents a chip that must be configured as a single unit.
@@ -1149,4 +1150,27 @@
*
*/
void setMloMode(in ChipMloMode mode);
+
+ /**
+ * Create an AP or bridged AP iface on the chip using vendor-provided configuration parameters.
+ *
+ * Depending on the mode the chip is configured in, the interface creation
+ * may fail (code: |WifiStatusCode.ERROR_NOT_AVAILABLE|) if we've already
+ * reached the maximum allowed (specified in |ChipIfaceCombination|) number
+ * of ifaces of the AP or AP_BRIDGED type.
+ *
+ * @param iface IfaceConcurrencyType to be created. Takes one of
+ |IfaceConcurrencyType.AP| or |IfaceConcurrencyType.AP_BRIDGED|
+ * @param vendorData Vendor-provided configuration data as a list of |OuiKeyedData|.
+ * @return AIDL interface object representing the iface if
+ * successful, null otherwise.
+ * @throws ServiceSpecificException with one of the following values:
+ * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
+ * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
+ * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
+ * |WifiStatusCode.ERROR_INVALID_ARGS|
+ */
+ @PropagateAllowBlocking
+ IWifiApIface createApOrBridgedApIface(
+ in IfaceConcurrencyType iface, in OuiKeyedData[] vendorData);
}
diff --git a/wifi/aidl/default/Android.bp b/wifi/aidl/default/Android.bp
index 91d609d..31a3531 100644
--- a/wifi/aidl/default/Android.bp
+++ b/wifi/aidl/default/Android.bp
@@ -105,7 +105,7 @@
"libwifi-hal",
"libwifi-system-iface",
"libxml2",
- "android.hardware.wifi-V1-ndk",
+ "android.hardware.wifi-V2-ndk",
],
export_include_dirs: ["."],
@@ -132,7 +132,7 @@
"libwifi-hal",
"libwifi-system-iface",
"libxml2",
- "android.hardware.wifi-V1-ndk",
+ "android.hardware.wifi-V2-ndk",
],
static_libs: ["android.hardware.wifi-service-lib"],
init_rc: ["android.hardware.wifi-service.rc"],
@@ -161,7 +161,7 @@
"libwifi-hal",
"libwifi-system-iface",
"libxml2",
- "android.hardware.wifi-V1-ndk",
+ "android.hardware.wifi-V2-ndk",
],
static_libs: ["android.hardware.wifi-service-lib"],
init_rc: ["android.hardware.wifi-service-lazy.rc"],
@@ -192,7 +192,8 @@
static_libs: [
"libgmock",
"libgtest",
- "android.hardware.wifi-V1-ndk",
+ "android.hardware.wifi-V2-ndk",
+ "android.hardware.wifi.common-V1-ndk",
"android.hardware.wifi-service-lib",
],
shared_libs: [
diff --git a/wifi/aidl/default/android.hardware.wifi-service.xml b/wifi/aidl/default/android.hardware.wifi-service.xml
index 5398ee7..3b68c8e 100644
--- a/wifi/aidl/default/android.hardware.wifi-service.xml
+++ b/wifi/aidl/default/android.hardware.wifi-service.xml
@@ -1,6 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.wifi</name>
+ <version>2</version>
<fqname>IWifi/default</fqname>
</hal>
</manifest>
diff --git a/wifi/aidl/default/wifi_chip.cpp b/wifi/aidl/default/wifi_chip.cpp
index 41b386c..d72775c 100644
--- a/wifi/aidl/default/wifi_chip.cpp
+++ b/wifi/aidl/default/wifi_chip.cpp
@@ -369,6 +369,14 @@
&WifiChip::createBridgedApIfaceInternal, _aidl_return);
}
+ndk::ScopedAStatus WifiChip::createApOrBridgedApIface(
+ IfaceConcurrencyType in_ifaceType, const std::vector<common::OuiKeyedData>& in_vendorData,
+ std::shared_ptr<IWifiApIface>* _aidl_return) {
+ return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
+ &WifiChip::createApOrBridgedApIfaceInternal, _aidl_return, in_ifaceType,
+ in_vendorData);
+}
+
ndk::ScopedAStatus WifiChip::getApIfaceNames(std::vector<std::string>* _aidl_return) {
return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
&WifiChip::getApIfaceNamesInternal, _aidl_return);
@@ -854,6 +862,18 @@
return {iface, ndk::ScopedAStatus::ok()};
}
+std::pair<std::shared_ptr<IWifiApIface>, ndk::ScopedAStatus>
+WifiChip::createApOrBridgedApIfaceInternal(
+ IfaceConcurrencyType ifaceType, const std::vector<common::OuiKeyedData>& /* vendorData */) {
+ if (ifaceType == IfaceConcurrencyType::AP) {
+ return createApIfaceInternal();
+ } else if (ifaceType == IfaceConcurrencyType::AP_BRIDGED) {
+ return createBridgedApIfaceInternal();
+ } else {
+ return {nullptr, createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS)};
+ }
+}
+
std::pair<std::vector<std::string>, ndk::ScopedAStatus> WifiChip::getApIfaceNamesInternal() {
if (ap_ifaces_.empty()) {
return {std::vector<std::string>(), ndk::ScopedAStatus::ok()};
diff --git a/wifi/aidl/default/wifi_chip.h b/wifi/aidl/default/wifi_chip.h
index 1a36032..c6517db 100644
--- a/wifi/aidl/default/wifi_chip.h
+++ b/wifi/aidl/default/wifi_chip.h
@@ -19,6 +19,7 @@
#include <aidl/android/hardware/wifi/BnWifiChip.h>
#include <aidl/android/hardware/wifi/IWifiRttController.h>
+#include <aidl/android/hardware/wifi/common/OuiKeyedData.h>
#include <android-base/macros.h>
#include <list>
@@ -96,6 +97,10 @@
ndk::ScopedAStatus requestFirmwareDebugDump(std::vector<uint8_t>* _aidl_return) override;
ndk::ScopedAStatus createApIface(std::shared_ptr<IWifiApIface>* _aidl_return) override;
ndk::ScopedAStatus createBridgedApIface(std::shared_ptr<IWifiApIface>* _aidl_return) override;
+ ndk::ScopedAStatus createApOrBridgedApIface(
+ IfaceConcurrencyType in_ifaceType,
+ const std::vector<common::OuiKeyedData>& in_vendorData,
+ std::shared_ptr<IWifiApIface>* _aidl_return) override;
ndk::ScopedAStatus getApIfaceNames(std::vector<std::string>* _aidl_return) override;
ndk::ScopedAStatus getApIface(const std::string& in_ifname,
std::shared_ptr<IWifiApIface>* _aidl_return) override;
@@ -176,6 +181,8 @@
ndk::ScopedAStatus createVirtualApInterface(const std::string& apVirtIf);
std::pair<std::shared_ptr<IWifiApIface>, ndk::ScopedAStatus> createApIfaceInternal();
std::pair<std::shared_ptr<IWifiApIface>, ndk::ScopedAStatus> createBridgedApIfaceInternal();
+ std::pair<std::shared_ptr<IWifiApIface>, ndk::ScopedAStatus> createApOrBridgedApIfaceInternal(
+ IfaceConcurrencyType ifaceType, const std::vector<common::OuiKeyedData>& vendorData);
std::pair<std::vector<std::string>, ndk::ScopedAStatus> getApIfaceNamesInternal();
std::pair<std::shared_ptr<IWifiApIface>, ndk::ScopedAStatus> getApIfaceInternal(
const std::string& ifname);
diff --git a/wifi/supplicant/aidl/Android.bp b/wifi/supplicant/aidl/Android.bp
index ac5a952..76b0902 100644
--- a/wifi/supplicant/aidl/Android.bp
+++ b/wifi/supplicant/aidl/Android.bp
@@ -57,6 +57,6 @@
},
],
- frozen: true,
+ frozen: false,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AuthAlgMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AuthAlgMask.aidl
index 9cd178d..4421018 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AuthAlgMask.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AuthAlgMask.aidl
@@ -34,8 +34,8 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum AuthAlgMask {
- OPEN = 1,
- SHARED = 2,
- LEAP = 4,
- SAE = 16,
+ OPEN = (1 << 0) /* 1 */,
+ SHARED = (1 << 1) /* 2 */,
+ LEAP = (1 << 2) /* 4 */,
+ SAE = (1 << 4) /* 16 */,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AuxiliarySupplicantEventCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AuxiliarySupplicantEventCode.aidl
index 471cfff..a339a92 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AuxiliarySupplicantEventCode.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AuxiliarySupplicantEventCode.aidl
@@ -34,7 +34,7 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum AuxiliarySupplicantEventCode {
- EAP_METHOD_SELECTED = 0,
- SSID_TEMP_DISABLED = 1,
- OPEN_SSL_FAILURE = 2,
+ EAP_METHOD_SELECTED,
+ SSID_TEMP_DISABLED,
+ OPEN_SSL_FAILURE,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/BssTmDataFlagsMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/BssTmDataFlagsMask.aidl
index f215f05..6f0045c 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/BssTmDataFlagsMask.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/BssTmDataFlagsMask.aidl
@@ -34,12 +34,12 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum BssTmDataFlagsMask {
- WNM_MODE_PREFERRED_CANDIDATE_LIST_INCLUDED = 1,
- WNM_MODE_ABRIDGED = 2,
- WNM_MODE_DISASSOCIATION_IMMINENT = 4,
- WNM_MODE_BSS_TERMINATION_INCLUDED = 8,
- WNM_MODE_ESS_DISASSOCIATION_IMMINENT = 16,
- MBO_TRANSITION_REASON_CODE_INCLUDED = 32,
- MBO_ASSOC_RETRY_DELAY_INCLUDED = 64,
- MBO_CELLULAR_DATA_CONNECTION_PREFERENCE_INCLUDED = 128,
+ WNM_MODE_PREFERRED_CANDIDATE_LIST_INCLUDED = (1 << 0) /* 1 */,
+ WNM_MODE_ABRIDGED = (1 << 1) /* 2 */,
+ WNM_MODE_DISASSOCIATION_IMMINENT = (1 << 2) /* 4 */,
+ WNM_MODE_BSS_TERMINATION_INCLUDED = (1 << 3) /* 8 */,
+ WNM_MODE_ESS_DISASSOCIATION_IMMINENT = (1 << 4) /* 16 */,
+ MBO_TRANSITION_REASON_CODE_INCLUDED = (1 << 5) /* 32 */,
+ MBO_ASSOC_RETRY_DELAY_INCLUDED = (1 << 6) /* 64 */,
+ MBO_CELLULAR_DATA_CONNECTION_PREFERENCE_INCLUDED = (1 << 7) /* 128 */,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppAkm.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppAkm.aidl
index df2aef8..730843d 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppAkm.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppAkm.aidl
@@ -34,8 +34,8 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum DppAkm {
- PSK = 0,
- PSK_SAE = 1,
- SAE = 2,
- DPP = 3,
+ PSK,
+ PSK_SAE,
+ SAE,
+ DPP,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppCurve.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppCurve.aidl
index e69da44..14cb49f 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppCurve.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppCurve.aidl
@@ -34,10 +34,10 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum DppCurve {
- PRIME256V1 = 0,
- SECP384R1 = 1,
- SECP521R1 = 2,
- BRAINPOOLP256R1 = 3,
- BRAINPOOLP384R1 = 4,
- BRAINPOOLP512R1 = 5,
+ PRIME256V1,
+ SECP384R1,
+ SECP521R1,
+ BRAINPOOLP256R1,
+ BRAINPOOLP384R1,
+ BRAINPOOLP512R1,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppEventType.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppEventType.aidl
index 9e394fc..47c8cc0 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppEventType.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppEventType.aidl
@@ -34,6 +34,6 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum DppEventType {
- CONFIGURATION_SENT = 0,
- CONFIGURATION_APPLIED = 1,
+ CONFIGURATION_SENT,
+ CONFIGURATION_APPLIED,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppFailureCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppFailureCode.aidl
index 7e7c806..89fbc4b 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppFailureCode.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppFailureCode.aidl
@@ -34,16 +34,16 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum DppFailureCode {
- INVALID_URI = 0,
- AUTHENTICATION = 1,
- NOT_COMPATIBLE = 2,
- CONFIGURATION = 3,
- BUSY = 4,
- TIMEOUT = 5,
- FAILURE = 6,
- NOT_SUPPORTED = 7,
- CONFIGURATION_REJECTED = 8,
- CANNOT_FIND_NETWORK = 9,
- ENROLLEE_AUTHENTICATION = 10,
- URI_GENERATION = 11,
+ INVALID_URI,
+ AUTHENTICATION,
+ NOT_COMPATIBLE,
+ CONFIGURATION,
+ BUSY,
+ TIMEOUT,
+ FAILURE,
+ NOT_SUPPORTED,
+ CONFIGURATION_REJECTED,
+ CANNOT_FIND_NETWORK,
+ ENROLLEE_AUTHENTICATION,
+ URI_GENERATION,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppNetRole.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppNetRole.aidl
index c6d3522..77a910b 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppNetRole.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppNetRole.aidl
@@ -34,6 +34,6 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum DppNetRole {
- STA = 0,
- AP = 1,
+ STA,
+ AP,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppProgressCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppProgressCode.aidl
index f0618a5..ea244de 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppProgressCode.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppProgressCode.aidl
@@ -34,8 +34,8 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum DppProgressCode {
- AUTHENTICATION_SUCCESS = 0,
- RESPONSE_PENDING = 1,
- CONFIGURATION_SENT_WAITING_RESPONSE = 2,
- CONFIGURATION_ACCEPTED = 3,
+ AUTHENTICATION_SUCCESS,
+ RESPONSE_PENDING,
+ CONFIGURATION_SENT_WAITING_RESPONSE,
+ CONFIGURATION_ACCEPTED,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppStatusErrorCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppStatusErrorCode.aidl
index d72633b..21f07dd 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppStatusErrorCode.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppStatusErrorCode.aidl
@@ -34,7 +34,7 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum DppStatusErrorCode {
- UNKNOWN = -1,
+ UNKNOWN = (-1) /* -1 */,
SUCCESS = 0,
NOT_COMPATIBLE = 1,
AUTH_FAILURE = 2,
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/GroupCipherMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/GroupCipherMask.aidl
index f2da925..d22d3d0 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/GroupCipherMask.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/GroupCipherMask.aidl
@@ -34,12 +34,12 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum GroupCipherMask {
- WEP40 = 2,
- WEP104 = 4,
- TKIP = 8,
- CCMP = 16,
- GTK_NOT_USED = 16384,
- GCMP_256 = 256,
- SMS4 = 128,
- GCMP_128 = 64,
+ WEP40 = (1 << 1) /* 2 */,
+ WEP104 = (1 << 2) /* 4 */,
+ TKIP = (1 << 3) /* 8 */,
+ CCMP = (1 << 4) /* 16 */,
+ GTK_NOT_USED = (1 << 14) /* 16384 */,
+ GCMP_256 = (1 << 8) /* 256 */,
+ SMS4 = (1 << 7) /* 128 */,
+ GCMP_128 = (1 << 6) /* 64 */,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/GroupMgmtCipherMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/GroupMgmtCipherMask.aidl
index c24d6cc..23bb04f 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/GroupMgmtCipherMask.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/GroupMgmtCipherMask.aidl
@@ -34,7 +34,7 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum GroupMgmtCipherMask {
- BIP_GMAC_128 = 2048,
- BIP_GMAC_256 = 4096,
- BIP_CMAC_256 = 8192,
+ BIP_GMAC_128 = (1 << 11) /* 2048 */,
+ BIP_GMAC_256 = (1 << 12) /* 4096 */,
+ BIP_CMAC_256 = (1 << 13) /* 8192 */,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl
index da3ca52..80d8546 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl
@@ -48,9 +48,17 @@
oneway void onProvisionDiscoveryCompleted(in byte[] p2pDeviceAddress, in boolean isRequest, in android.hardware.wifi.supplicant.P2pProvDiscStatusCode status, in android.hardware.wifi.supplicant.WpsConfigMethods configMethods, in String generatedPin);
oneway void onR2DeviceFound(in byte[] srcAddress, in byte[] p2pDeviceAddress, in byte[] primaryDeviceType, in String deviceName, in android.hardware.wifi.supplicant.WpsConfigMethods configMethods, in byte deviceCapabilities, in android.hardware.wifi.supplicant.P2pGroupCapabilityMask groupCapabilities, in byte[] wfdDeviceInfo, in byte[] wfdR2DeviceInfo);
oneway void onServiceDiscoveryResponse(in byte[] srcAddress, in char updateIndicator, in byte[] tlvs);
+ /**
+ * @deprecated This callback is deprecated from AIDL v3, newer HAL should call onPeerClientJoined()
+ */
oneway void onStaAuthorized(in byte[] srcAddress, in byte[] p2pDeviceAddress);
+ /**
+ * @deprecated This callback is deprecated from AIDL v3, newer HAL should call onPeerClientDisconnected()
+ */
oneway void onStaDeauthorized(in byte[] srcAddress, in byte[] p2pDeviceAddress);
oneway void onGroupFrequencyChanged(in String groupIfname, in int frequency);
oneway void onDeviceFoundWithVendorElements(in byte[] srcAddress, in byte[] p2pDeviceAddress, in byte[] primaryDeviceType, in String deviceName, in android.hardware.wifi.supplicant.WpsConfigMethods configMethods, in byte deviceCapabilities, in android.hardware.wifi.supplicant.P2pGroupCapabilityMask groupCapabilities, in byte[] wfdDeviceInfo, in byte[] wfdR2DeviceInfo, in byte[] vendorElemBytes);
oneway void onGroupStartedWithParams(in android.hardware.wifi.supplicant.P2pGroupStartedEventParams groupStartedEventParams);
+ oneway void onPeerClientJoined(in android.hardware.wifi.supplicant.P2pPeerClientJoinedEventParams clientJoinedEventParams);
+ oneway void onPeerClientDisconnected(in android.hardware.wifi.supplicant.P2pPeerClientDisconnectedEventParams clientDisconnectedEventParams);
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/IfaceType.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/IfaceType.aidl
index 557dbd7..e11c2f7 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/IfaceType.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/IfaceType.aidl
@@ -34,6 +34,6 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum IfaceType {
- STA = 0,
- P2P = 1,
+ STA,
+ P2P,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/IpVersion.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/IpVersion.aidl
index f571b44..9580314 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/IpVersion.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/IpVersion.aidl
@@ -34,6 +34,6 @@
package android.hardware.wifi.supplicant;
@Backing(type="byte") @VintfStability
enum IpVersion {
- VERSION_4 = 0,
- VERSION_6 = 1,
+ VERSION_4,
+ VERSION_6,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/KeyMgmtMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/KeyMgmtMask.aidl
index 7228480..35d51bc 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/KeyMgmtMask.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/KeyMgmtMask.aidl
@@ -34,21 +34,21 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum KeyMgmtMask {
- WPA_EAP = 1,
- WPA_PSK = 2,
- NONE = 4,
- IEEE8021X = 8,
- FT_EAP = 32,
- FT_PSK = 64,
- OSEN = 32768,
- WPA_EAP_SHA256 = 128,
- WPA_PSK_SHA256 = 256,
- SAE = 1024,
- SUITE_B_192 = 131072,
- OWE = 4194304,
- DPP = 8388608,
- WAPI_PSK = 4096,
- WAPI_CERT = 8192,
- FILS_SHA256 = 262144,
- FILS_SHA384 = 524288,
+ WPA_EAP = (1 << 0) /* 1 */,
+ WPA_PSK = (1 << 1) /* 2 */,
+ NONE = (1 << 2) /* 4 */,
+ IEEE8021X = (1 << 3) /* 8 */,
+ FT_EAP = (1 << 5) /* 32 */,
+ FT_PSK = (1 << 6) /* 64 */,
+ OSEN = (1 << 15) /* 32768 */,
+ WPA_EAP_SHA256 = (1 << 7) /* 128 */,
+ WPA_PSK_SHA256 = (1 << 8) /* 256 */,
+ SAE = (1 << 10) /* 1024 */,
+ SUITE_B_192 = (1 << 17) /* 131072 */,
+ OWE = (1 << 22) /* 4194304 */,
+ DPP = (1 << 23) /* 8388608 */,
+ WAPI_PSK = (1 << 12) /* 4096 */,
+ WAPI_CERT = (1 << 13) /* 8192 */,
+ FILS_SHA256 = (1 << 18) /* 262144 */,
+ FILS_SHA384 = (1 << 19) /* 524288 */,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/OcspType.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/OcspType.aidl
index 89de811..d5ed084 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/OcspType.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/OcspType.aidl
@@ -34,8 +34,8 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum OcspType {
- NONE = 0,
- REQUEST_CERT_STATUS = 1,
- REQUIRE_CERT_STATUS = 2,
- REQUIRE_ALL_CERTS_STATUS = 3,
+ NONE,
+ REQUEST_CERT_STATUS,
+ REQUIRE_CERT_STATUS,
+ REQUIRE_ALL_CERTS_STATUS,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pFrameTypeMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pFrameTypeMask.aidl
index 6e1b957..3c6f8ed 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pFrameTypeMask.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pFrameTypeMask.aidl
@@ -34,17 +34,17 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum P2pFrameTypeMask {
- P2P_FRAME_PROBE_REQ_P2P = 1,
- P2P_FRAME_PROBE_RESP_P2P = 2,
- P2P_FRAME_PROBE_RESP_P2P_GO = 4,
- P2P_FRAME_BEACON_P2P_GO = 8,
- P2P_FRAME_P2P_PD_REQ = 16,
- P2P_FRAME_P2P_PD_RESP = 32,
- P2P_FRAME_P2P_GO_NEG_REQ = 64,
- P2P_FRAME_P2P_GO_NEG_RESP = 128,
- P2P_FRAME_P2P_GO_NEG_CONF = 256,
- P2P_FRAME_P2P_INV_REQ = 512,
- P2P_FRAME_P2P_INV_RESP = 1024,
- P2P_FRAME_P2P_ASSOC_REQ = 2048,
- P2P_FRAME_P2P_ASSOC_RESP = 4096,
+ P2P_FRAME_PROBE_REQ_P2P = (1 << 0) /* 1 */,
+ P2P_FRAME_PROBE_RESP_P2P = (1 << 1) /* 2 */,
+ P2P_FRAME_PROBE_RESP_P2P_GO = (1 << 2) /* 4 */,
+ P2P_FRAME_BEACON_P2P_GO = (1 << 3) /* 8 */,
+ P2P_FRAME_P2P_PD_REQ = (1 << 4) /* 16 */,
+ P2P_FRAME_P2P_PD_RESP = (1 << 5) /* 32 */,
+ P2P_FRAME_P2P_GO_NEG_REQ = (1 << 6) /* 64 */,
+ P2P_FRAME_P2P_GO_NEG_RESP = (1 << 7) /* 128 */,
+ P2P_FRAME_P2P_GO_NEG_CONF = (1 << 8) /* 256 */,
+ P2P_FRAME_P2P_INV_REQ = (1 << 9) /* 512 */,
+ P2P_FRAME_P2P_INV_RESP = (1 << 10) /* 1024 */,
+ P2P_FRAME_P2P_ASSOC_REQ = (1 << 11) /* 2048 */,
+ P2P_FRAME_P2P_ASSOC_RESP = (1 << 12) /* 4096 */,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pGroupCapabilityMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pGroupCapabilityMask.aidl
index ffee12c..e477131 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pGroupCapabilityMask.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pGroupCapabilityMask.aidl
@@ -34,11 +34,11 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum P2pGroupCapabilityMask {
- GROUP_OWNER = 1,
- PERSISTENT_GROUP = 2,
- GROUP_LIMIT = 4,
- INTRA_BSS_DIST = 8,
- CROSS_CONN = 16,
- PERSISTENT_RECONN = 32,
- GROUP_FORMATION = 64,
+ GROUP_OWNER = (1 << 0) /* 1 */,
+ PERSISTENT_GROUP = (1 << 1) /* 2 */,
+ GROUP_LIMIT = (1 << 2) /* 4 */,
+ INTRA_BSS_DIST = (1 << 3) /* 8 */,
+ CROSS_CONN = (1 << 4) /* 16 */,
+ PERSISTENT_RECONN = (1 << 5) /* 32 */,
+ GROUP_FORMATION = (1 << 6) /* 64 */,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pPeerClientDisconnectedEventParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pPeerClientDisconnectedEventParams.aidl
new file mode 100644
index 0000000..90e9f5e
--- /dev/null
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pPeerClientDisconnectedEventParams.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.wifi.supplicant;
+@VintfStability
+parcelable P2pPeerClientDisconnectedEventParams {
+ String groupInterfaceName;
+ byte[6] clientInterfaceAddress;
+ byte[6] clientDeviceAddress;
+}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pPeerClientJoinedEventParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pPeerClientJoinedEventParams.aidl
new file mode 100644
index 0000000..800f5b3
--- /dev/null
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pPeerClientJoinedEventParams.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.wifi.supplicant;
+@VintfStability
+parcelable P2pPeerClientJoinedEventParams {
+ String groupInterfaceName;
+ byte[6] clientInterfaceAddress;
+ byte[6] clientDeviceAddress;
+ int clientIpAddress;
+}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/PairwiseCipherMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/PairwiseCipherMask.aidl
index d9b00e1..a4c7b60 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/PairwiseCipherMask.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/PairwiseCipherMask.aidl
@@ -34,10 +34,10 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum PairwiseCipherMask {
- NONE = 1,
- TKIP = 8,
- CCMP = 16,
- GCMP_128 = 64,
- SMS4 = 128,
- GCMP_256 = 256,
+ NONE = (1 << 0) /* 1 */,
+ TKIP = (1 << 3) /* 8 */,
+ CCMP = (1 << 4) /* 16 */,
+ GCMP_128 = (1 << 6) /* 64 */,
+ SMS4 = (1 << 7) /* 128 */,
+ GCMP_256 = (1 << 8) /* 256 */,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ProtoMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ProtoMask.aidl
index de92428..ba79025 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ProtoMask.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ProtoMask.aidl
@@ -34,8 +34,8 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum ProtoMask {
- WPA = 1,
- RSN = 2,
- WAPI = 4,
- OSEN = 8,
+ WPA = (1 << 0) /* 1 */,
+ RSN = (1 << 1) /* 2 */,
+ WAPI = (1 << 2) /* 4 */,
+ OSEN = (1 << 3) /* 8 */,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl
index 9c0c0b6..fda5e3e 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl
@@ -34,12 +34,12 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum QosPolicyClassifierParamsMask {
- SRC_IP = 1,
- DST_IP = 2,
- SRC_PORT = 4,
- DST_PORT_RANGE = 8,
- PROTOCOL_NEXT_HEADER = 16,
- FLOW_LABEL = 32,
- DOMAIN_NAME = 64,
- DSCP = 128,
+ SRC_IP = (1 << 0) /* 1 */,
+ DST_IP = (1 << 1) /* 2 */,
+ SRC_PORT = (1 << 2) /* 4 */,
+ DST_PORT_RANGE = (1 << 3) /* 8 */,
+ PROTOCOL_NEXT_HEADER = (1 << 4) /* 16 */,
+ FLOW_LABEL = (1 << 5) /* 32 */,
+ DOMAIN_NAME = (1 << 6) /* 64 */,
+ DSCP = (1 << 7) /* 128 */,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyRequestType.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyRequestType.aidl
index 4c1e4fa..fd4e787 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyRequestType.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyRequestType.aidl
@@ -34,6 +34,6 @@
package android.hardware.wifi.supplicant;
@Backing(type="byte") @VintfStability
enum QosPolicyRequestType {
- QOS_POLICY_ADD = 0,
- QOS_POLICY_REMOVE = 1,
+ QOS_POLICY_ADD,
+ QOS_POLICY_REMOVE,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsRequestStatusCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsRequestStatusCode.aidl
index 4d81566..8e0467f 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsRequestStatusCode.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsRequestStatusCode.aidl
@@ -19,8 +19,8 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum QosPolicyScsRequestStatusCode {
- SENT = 0,
- ALREADY_ACTIVE = 1,
- NOT_EXIST = 2,
- INVALID = 3,
+ SENT,
+ ALREADY_ACTIVE,
+ NOT_EXIST,
+ INVALID,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsResponseStatusCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsResponseStatusCode.aidl
index 693d3e0..5d460c6 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsResponseStatusCode.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsResponseStatusCode.aidl
@@ -19,13 +19,13 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum QosPolicyScsResponseStatusCode {
- SUCCESS = 0,
- TCLAS_REQUEST_DECLINED = 1,
- TCLAS_NOT_SUPPORTED_BY_AP = 2,
- TCLAS_INSUFFICIENT_RESOURCES = 3,
- TCLAS_RESOURCES_EXHAUSTED = 4,
- TCLAS_PROCESSING_TERMINATED_INSUFFICIENT_QOS = 5,
- TCLAS_PROCESSING_TERMINATED_POLICY_CONFLICT = 6,
- TCLAS_PROCESSING_TERMINATED = 7,
- TIMEOUT = 8,
+ SUCCESS,
+ TCLAS_REQUEST_DECLINED,
+ TCLAS_NOT_SUPPORTED_BY_AP,
+ TCLAS_INSUFFICIENT_RESOURCES,
+ TCLAS_RESOURCES_EXHAUSTED,
+ TCLAS_PROCESSING_TERMINATED_INSUFFICIENT_QOS,
+ TCLAS_PROCESSING_TERMINATED_POLICY_CONFLICT,
+ TCLAS_PROCESSING_TERMINATED,
+ TIMEOUT,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyStatusCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyStatusCode.aidl
index 4d40edc..9228632 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyStatusCode.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyStatusCode.aidl
@@ -34,8 +34,8 @@
package android.hardware.wifi.supplicant;
@Backing(type="byte") @VintfStability
enum QosPolicyStatusCode {
- QOS_POLICY_SUCCESS = 0,
- QOS_POLICY_REQUEST_DECLINED = 1,
- QOS_POLICY_CLASSIFIER_NOT_SUPPORTED = 2,
- QOS_POLICY_INSUFFICIENT_RESOURCES = 3,
+ QOS_POLICY_SUCCESS,
+ QOS_POLICY_REQUEST_DECLINED,
+ QOS_POLICY_CLASSIFIER_NOT_SUPPORTED,
+ QOS_POLICY_INSUFFICIENT_RESOURCES,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SaeH2eMode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SaeH2eMode.aidl
index 978c337..4730d72 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SaeH2eMode.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SaeH2eMode.aidl
@@ -34,7 +34,7 @@
package android.hardware.wifi.supplicant;
@Backing(type="byte") @VintfStability
enum SaeH2eMode {
- DISABLED = 0,
- H2E_OPTIONAL = 1,
- H2E_MANDATORY = 2,
+ DISABLED,
+ H2E_OPTIONAL,
+ H2E_MANDATORY,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl
index d84ff95..d7ff798 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl
@@ -34,16 +34,16 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum SupplicantStatusCode {
- SUCCESS = 0,
- FAILURE_UNKNOWN = 1,
- FAILURE_ARGS_INVALID = 2,
- FAILURE_IFACE_INVALID = 3,
- FAILURE_IFACE_UNKNOWN = 4,
- FAILURE_IFACE_EXISTS = 5,
- FAILURE_IFACE_DISABLED = 6,
- FAILURE_IFACE_NOT_DISCONNECTED = 7,
- FAILURE_NETWORK_INVALID = 8,
- FAILURE_NETWORK_UNKNOWN = 9,
- FAILURE_UNSUPPORTED = 10,
- FAILURE_ONGOING_REQUEST = 11,
+ SUCCESS,
+ FAILURE_UNKNOWN,
+ FAILURE_ARGS_INVALID,
+ FAILURE_IFACE_INVALID,
+ FAILURE_IFACE_UNKNOWN,
+ FAILURE_IFACE_EXISTS,
+ FAILURE_IFACE_DISABLED,
+ FAILURE_IFACE_NOT_DISCONNECTED,
+ FAILURE_NETWORK_INVALID,
+ FAILURE_NETWORK_UNKNOWN,
+ FAILURE_UNSUPPORTED,
+ FAILURE_ONGOING_REQUEST,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/TlsVersion.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/TlsVersion.aidl
index 22a374f..b31826a 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/TlsVersion.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/TlsVersion.aidl
@@ -34,8 +34,8 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum TlsVersion {
- TLS_V1_0 = 0,
- TLS_V1_1 = 1,
- TLS_V1_2 = 2,
- TLS_V1_3 = 3,
+ TLS_V1_0,
+ TLS_V1_1,
+ TLS_V1_2,
+ TLS_V1_3,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/TransitionDisableIndication.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/TransitionDisableIndication.aidl
index 7c63217..f1d7370 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/TransitionDisableIndication.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/TransitionDisableIndication.aidl
@@ -34,8 +34,8 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum TransitionDisableIndication {
- USE_WPA3_PERSONAL = 1,
- USE_SAE_PK = 2,
- USE_WPA3_ENTERPRISE = 4,
- USE_ENHANCED_OPEN = 8,
+ USE_WPA3_PERSONAL = (1 << 0) /* 1 */,
+ USE_SAE_PK = (1 << 1) /* 2 */,
+ USE_WPA3_ENTERPRISE = (1 << 2) /* 4 */,
+ USE_ENHANCED_OPEN = (1 << 3) /* 8 */,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.aidl
index 32e1510..330f2aa 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.aidl
@@ -34,11 +34,11 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum WpaDriverCapabilitiesMask {
- MBO = 1,
- OCE = 2,
- SAE_PK = 4,
- WFD_R2 = 8,
- TRUST_ON_FIRST_USE = 16,
- SET_TLS_MINIMUM_VERSION = 32,
- TLS_V1_3 = 64,
+ MBO = (1 << 0) /* 1 */,
+ OCE = (1 << 1) /* 2 */,
+ SAE_PK = (1 << 2) /* 4 */,
+ WFD_R2 = (1 << 3) /* 8 */,
+ TRUST_ON_FIRST_USE = (1 << 4) /* 16 */,
+ SET_TLS_MINIMUM_VERSION = (1 << 5) /* 32 */,
+ TLS_V1_3 = (1 << 6) /* 64 */,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsConfigMethods.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsConfigMethods.aidl
index c98c479..b9ea211 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsConfigMethods.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsConfigMethods.aidl
@@ -34,18 +34,18 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum WpsConfigMethods {
- USBA = 1,
- ETHERNET = 2,
- LABEL = 4,
- DISPLAY = 8,
- EXT_NFC_TOKEN = 16,
- INT_NFC_TOKEN = 32,
- NFC_INTERFACE = 64,
- PUSHBUTTON = 128,
- KEYPAD = 256,
- VIRT_PUSHBUTTON = 640,
- PHY_PUSHBUTTON = 1152,
- P2PS = 4096,
- VIRT_DISPLAY = 8200,
- PHY_DISPLAY = 16392,
+ USBA = 0x0001,
+ ETHERNET = 0x0002,
+ LABEL = 0x0004,
+ DISPLAY = 0x0008,
+ EXT_NFC_TOKEN = 0x0010,
+ INT_NFC_TOKEN = 0x0020,
+ NFC_INTERFACE = 0x0040,
+ PUSHBUTTON = 0x0080,
+ KEYPAD = 0x0100,
+ VIRT_PUSHBUTTON = 0x0280,
+ PHY_PUSHBUTTON = 0x0480,
+ P2PS = 0x1000,
+ VIRT_DISPLAY = 0x2008,
+ PHY_DISPLAY = 0x4008,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsDevPasswordId.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsDevPasswordId.aidl
index 975f1ab..9a20187 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsDevPasswordId.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsDevPasswordId.aidl
@@ -34,12 +34,12 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum WpsDevPasswordId {
- DEFAULT = 0,
- USER_SPECIFIED = 1,
- MACHINE_SPECIFIED = 2,
- REKEY = 3,
- PUSHBUTTON = 4,
- REGISTRAR_SPECIFIED = 5,
- NFC_CONNECTION_HANDOVER = 7,
- P2PS_DEFAULT = 8,
+ DEFAULT = 0x0000,
+ USER_SPECIFIED = 0x0001,
+ MACHINE_SPECIFIED = 0x0002,
+ REKEY = 0x0003,
+ PUSHBUTTON = 0x0004,
+ REGISTRAR_SPECIFIED = 0x0005,
+ NFC_CONNECTION_HANDOVER = 0x0007,
+ P2PS_DEFAULT = 0x0008,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsProvisionMethod.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsProvisionMethod.aidl
index f6dba23..177d218 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsProvisionMethod.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsProvisionMethod.aidl
@@ -34,7 +34,7 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum WpsProvisionMethod {
- PBC = 0,
- DISPLAY = 1,
- KEYPAD = 2,
+ PBC,
+ DISPLAY,
+ KEYPAD,
}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl
index 9d6fa67..810fe48 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl
@@ -18,6 +18,8 @@
import android.hardware.wifi.supplicant.P2pGroupCapabilityMask;
import android.hardware.wifi.supplicant.P2pGroupStartedEventParams;
+import android.hardware.wifi.supplicant.P2pPeerClientDisconnectedEventParams;
+import android.hardware.wifi.supplicant.P2pPeerClientJoinedEventParams;
import android.hardware.wifi.supplicant.P2pProvDiscStatusCode;
import android.hardware.wifi.supplicant.P2pStatusCode;
import android.hardware.wifi.supplicant.WpsConfigMethods;
@@ -192,6 +194,9 @@
/**
* Used to indicate when a STA device is connected to this device.
+ * <p>
+ * @deprecated This callback is deprecated from AIDL v3, newer HAL should call
+ * onPeerClientJoined()
*
* @param srcAddress MAC address of the device that was authorized.
* @param p2pDeviceAddress P2P device address.
@@ -200,6 +205,9 @@
/**
* Used to indicate when a STA device is disconnected from this device.
+ * <p>
+ * @deprecated This callback is deprecated from AIDL v3, newer HAL should call
+ * onPeerClientDisconnected()
*
* @param srcAddress MAC address of the device that was deauthorized.
* @param p2pDeviceAddress P2P device address.
@@ -251,4 +259,20 @@
* @param groupStartedEventParams Parameters describing the P2P group.
*/
void onGroupStartedWithParams(in P2pGroupStartedEventParams groupStartedEventParams);
+
+ /**
+ * Used to indicate that a P2P client has joined this device group owner.
+ *
+ * @param clientJoinedEventParams Parameters associated with peer client joined event.
+ */
+ void onPeerClientJoined(in P2pPeerClientJoinedEventParams clientJoinedEventParams);
+
+ /**
+ * Used to indicate that a P2P client has disconnected from this device group owner.
+ *
+ * @param clientDisconnectedEventParams Parameters associated with peer client disconnected
+ * event.
+ */
+ void onPeerClientDisconnected(
+ in P2pPeerClientDisconnectedEventParams clientDisconnectedEventParams);
}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pPeerClientDisconnectedEventParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pPeerClientDisconnectedEventParams.aidl
new file mode 100644
index 0000000..936efd1
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pPeerClientDisconnectedEventParams.aidl
@@ -0,0 +1,32 @@
+/*
+ * 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.wifi.supplicant;
+
+/**
+ * Parameters passed as a part of P2P peer client disconnected event.
+ */
+@VintfStability
+parcelable P2pPeerClientDisconnectedEventParams {
+ /** Interface name of this device group owner. (For ex: p2p-p2p0-1) */
+ String groupInterfaceName;
+
+ /** P2P group interface MAC address of the client that disconnected. */
+ byte[6] clientInterfaceAddress;
+
+ /** P2P device interface MAC address of the client that disconnected. */
+ byte[6] clientDeviceAddress;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pPeerClientJoinedEventParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pPeerClientJoinedEventParams.aidl
new file mode 100644
index 0000000..7eae2e5
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pPeerClientJoinedEventParams.aidl
@@ -0,0 +1,42 @@
+/*
+ * 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.wifi.supplicant;
+
+/**
+ * Parameters passed as a part of P2P peer client joined event.
+ */
+@VintfStability
+parcelable P2pPeerClientJoinedEventParams {
+ /** Interface name of this device group owner. (For ex: p2p-p2p0-1) */
+ String groupInterfaceName;
+
+ /** P2P group interface MAC address of the client that joined. */
+ byte[6] clientInterfaceAddress;
+
+ /** P2P device interface MAC address of the client that joined. */
+ byte[6] clientDeviceAddress;
+
+ /**
+ * The P2P Client IPV4 address allocated via EAPOL exchange.
+ * The higher-order address bytes are in the lower-order int bytes
+ * (e.g. 1.2.3.4 is represented as 0x04030201).
+ * Refer Wi-Fi P2P Technical Specification v1.7 - Section 4.2.8
+ * "IP Address Allocation in EAPOL-Key Frames (4-Way Handshake)" for more details.
+ * The value is set to zero if the IP address is not allocated via EAPOL exchange.
+ */
+ int clientIpAddress;
+}
diff --git a/wifi/supplicant/aidl/vts/functional/Android.bp b/wifi/supplicant/aidl/vts/functional/Android.bp
index f7c619a..4eec180 100644
--- a/wifi/supplicant/aidl/vts/functional/Android.bp
+++ b/wifi/supplicant/aidl/vts/functional/Android.bp
@@ -44,7 +44,7 @@
"android.hardware.wifi@1.5",
"android.hardware.wifi.supplicant@1.0",
"android.hardware.wifi.supplicant@1.1",
- "android.hardware.wifi.supplicant-V2-ndk",
+ "android.hardware.wifi.supplicant-V3-ndk",
"libwifi-system",
"libwifi-system-iface",
"VtsHalWifiV1_0TargetTestUtil",
@@ -80,7 +80,7 @@
"android.hardware.wifi@1.5",
"android.hardware.wifi.supplicant@1.0",
"android.hardware.wifi.supplicant@1.1",
- "android.hardware.wifi.supplicant-V2-ndk",
+ "android.hardware.wifi.supplicant-V3-ndk",
"libwifi-system",
"libwifi-system-iface",
"VtsHalWifiV1_0TargetTestUtil",
@@ -116,7 +116,7 @@
"android.hardware.wifi@1.5",
"android.hardware.wifi.supplicant@1.0",
"android.hardware.wifi.supplicant@1.1",
- "android.hardware.wifi.supplicant-V2-ndk",
+ "android.hardware.wifi.supplicant-V3-ndk",
"libwifi-system",
"libwifi-system-iface",
"VtsHalWifiV1_0TargetTestUtil",
diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp b/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp
index a260408..d3dd2e0 100644
--- a/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp
+++ b/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp
@@ -38,6 +38,8 @@
using aidl::android::hardware::wifi::supplicant::P2pFrameTypeMask;
using aidl::android::hardware::wifi::supplicant::P2pGroupCapabilityMask;
using aidl::android::hardware::wifi::supplicant::P2pGroupStartedEventParams;
+using aidl::android::hardware::wifi::supplicant::P2pPeerClientDisconnectedEventParams;
+using aidl::android::hardware::wifi::supplicant::P2pPeerClientJoinedEventParams;
using aidl::android::hardware::wifi::supplicant::P2pProvDiscStatusCode;
using aidl::android::hardware::wifi::supplicant::P2pStatusCode;
using aidl::android::hardware::wifi::supplicant::SupplicantStatusCode;
@@ -182,6 +184,15 @@
const P2pGroupStartedEventParams& /* groupStartedEventParams */) override {
return ndk::ScopedAStatus::ok();
}
+ ::ndk::ScopedAStatus onPeerClientJoined(
+ const P2pPeerClientJoinedEventParams& /* clientJoinedEventParams */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onPeerClientDisconnected(
+ const P2pPeerClientDisconnectedEventParams& /* clientDisconnectedEventParams */)
+ override {
+ return ndk::ScopedAStatus::ok();
+ }
};
class SupplicantP2pIfaceAidlTest : public testing::TestWithParam<std::string> {