Merge "Added INFO_VEHICLE_SIZE_CLASS to HAL" into main
diff --git a/audio/aidl/android/hardware/audio/effect/IFactory.aidl b/audio/aidl/android/hardware/audio/effect/IFactory.aidl
index b80e6ac..75d4d9e 100644
--- a/audio/aidl/android/hardware/audio/effect/IFactory.aidl
+++ b/audio/aidl/android/hardware/audio/effect/IFactory.aidl
@@ -74,13 +74,18 @@
/**
* Called by the framework to destroy the effect and free up all currently allocated resources.
- * It is recommended to destroy the effect from the client side as soon as it is becomes unused.
+ * This method can be called at any time to destroy an effect instance. It is recommended to
+ * destroy the effect from the client side as soon as it becomes unused to free up resources.
*
- * The client must ensure effect instance is closed before destroy.
+ * The effect instance must handle any necessary cleanup and resource deallocation.
+ * If the effect is in the **PROCESSING** or **DRAINING** state, it must gracefully stop
+ * processing before destruction.
+ * The effect must ensure that all internal states are properly cleaned up to prevent resource
+ * leaks.
*
* @param handle The handle of effect instance to be destroyed.
* @throws EX_ILLEGAL_ARGUMENT if the effect handle is not valid.
- * @throws EX_ILLEGAL_STATE if the effect instance is not in a proper state to be destroyed.
+ * @throws EX_ILLEGAL_STATE if the effect instance can not be destroyed.
*/
void destroyEffect(in IEffect handle);
}
diff --git a/audio/aidl/android/hardware/audio/effect/State.aidl b/audio/aidl/android/hardware/audio/effect/State.aidl
index 1b698d7..ecd1bbe 100644
--- a/audio/aidl/android/hardware/audio/effect/State.aidl
+++ b/audio/aidl/android/hardware/audio/effect/State.aidl
@@ -24,6 +24,8 @@
* it should transfer to IDLE state after handle the command successfully. Effect instance should
* consume minimal resource and transfer to INIT state after it was close().
*
+ * An effect instance can be destroyed from any state using `IFactory.destroyEffect()`.
+ *
* Refer to the state machine diagram `state.gv` for a detailed state diagram.
*/
@VintfStability
@@ -66,6 +68,7 @@
* - Transitions to **INIT** on `IEffect.close()`.
* - Remains in **IDLE** on `IEffect.getParameter()`, `IEffect.setParameter()`,
* `IEffect.getDescriptor()`, `IEffect.command(CommandId.RESET)`, and `IEffect.reopen()`.
+ * - Transitions to the final state on `IFactory.destroyEffect()`.
*/
IDLE,
@@ -98,6 +101,7 @@
* stop processing with `CommandId.STOP` before closing.
* - If `IEffect.close()` is called in this state, the effect instance should stop processing,
* transition to **IDLE**, and then close.
+ * - Transitions to the final state on `IFactory.destroyEffect()`.
*/
PROCESSING,
@@ -123,6 +127,7 @@
* - If not implemented, the effect instance may transition directly from **PROCESSING** to
* **IDLE** without this intermediate state.
* - Any `CommandId.STOP` commands received during **DRAINING** should be ignored.
+ * - Transitions to the final state on `IFactory.destroyEffect()`.
*/
DRAINING,
}
diff --git a/audio/aidl/android/hardware/audio/effect/state.gv b/audio/aidl/android/hardware/audio/effect/state.gv
index 2a8194e..8590296 100644
--- a/audio/aidl/android/hardware/audio/effect/state.gv
+++ b/audio/aidl/android/hardware/audio/effect/state.gv
@@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// To render: "dot -Tpng state.gv -o state.png"
+// To render: "dot -Tpng state.gv -o state.png"
digraph effect_state_machine {
rankdir=LR; // Left to Right layout
@@ -29,40 +29,30 @@
I [shape=point, fillcolor=black, width=0.2];
// Final state node
- F [shape=doublecircle, fillcolor=white, width=0.2];
+ F [shape=doublecircle, label="Destroyed"];
// Define other nodes with colors
- INIT [shape=ellipse, fillcolor=lightgreen];
- IDLE [shape=ellipse, fillcolor=lightblue];
- PROCESSING [shape=ellipse, fillcolor=lightyellow];
- DRAINING [shape=ellipse, fillcolor=lightgrey];
+ INIT [shape=ellipse, fillcolor=lightgreen, label="INIT"];
+ IDLE [shape=ellipse, fillcolor=lightblue, label="IDLE"];
+ PROCESSING [shape=ellipse, fillcolor=lightyellow, label="PROCESSING"];
+ DRAINING [shape=ellipse, fillcolor=lightgrey, label="DRAINING"];
+ ANY_STATE [shape=ellipse, style=dashed, label="Any State", fillcolor=white];
- // Transitions
+ // Main transitions
I -> INIT [label="IFactory.createEffect", fontcolor="navy"];
-
- INIT -> F [label="IFactory.destroyEffect"];
-
INIT -> IDLE [label="IEffect.open()", fontcolor="lime"];
-
IDLE -> PROCESSING [label="IEffect.command(START)"];
-
- PROCESSING -> IDLE [label="IEffect.command(STOP)\nIEffect.command(RESET)"];
-
- PROCESSING -> DRAINING [label="IEffect.command(STOP)", fontcolor="orange"];
-
- DRAINING -> IDLE [label="Draining complete\n(IEffect.command(RESET)\nautomatic)"];
-
- DRAINING -> PROCESSING [label="IEffect.command(START)\n(Interrupt draining)"];
-
+ PROCESSING -> IDLE [label="IEffect.command(STOP) (if draining not required)\nIEffect.command(RESET)"];
+ PROCESSING -> DRAINING [label="IEffect.command(STOP) (if draining required)", fontcolor="orange"];
+ DRAINING -> IDLE [label="IEffect.command(RESET)\nDraining complete (automatic transition)"];
+ DRAINING -> PROCESSING [label="IEffect.command(START) (Interrupt draining)"];
IDLE -> INIT [label="IEffect.close()"];
- // Self-loops
- INIT -> INIT [label="IEffect.getState\nIEffect.getDescriptor"];
-
- IDLE -> IDLE [label="IEffect.getParameter\nIEffect.setParameter\nIEffect.getDescriptor\nIEffect.command(RESET)\nIEffect.reopen"];
-
- PROCESSING -> PROCESSING [label="IEffect.getParameter\nIEffect.setParameter\nIEffect.getDescriptor\nIEffect.reopen"];
-
- DRAINING -> DRAINING [label="IEffect.getParameter\nIEffect.setParameter\nIEffect.getDescriptor\nIEffect.reopen\nFading"];
-
+ // Global transitions
+ subgraph cluster_global_transitions {
+ label="Global Transitions (Any State)";
+ style=dashed;
+ ANY_STATE -> F [label="IFactory.destroyEffect", style="bold"];
+ ANY_STATE -> ANY_STATE [label="IEffect.getParameter\nIEffect.setParameter\nIEffect.getDescriptor\nIEffect.getState\nIEffect.reopen", fontsize=10];
+ }
}
diff --git a/audio/aidl/default/EffectImpl.cpp b/audio/aidl/default/EffectImpl.cpp
index 7857f53..97f7286 100644
--- a/audio/aidl/default/EffectImpl.cpp
+++ b/audio/aidl/default/EffectImpl.cpp
@@ -22,7 +22,10 @@
#include "effect-impl/EffectTypes.h"
#include "include/effect-impl/EffectTypes.h"
+using aidl::android::hardware::audio::effect::CommandId;
+using aidl::android::hardware::audio::effect::Descriptor;
using aidl::android::hardware::audio::effect::IEffect;
+using aidl::android::hardware::audio::effect::kDestroyAnyStateSupportedVersion;
using aidl::android::hardware::audio::effect::kEventFlagDataMqNotEmpty;
using aidl::android::hardware::audio::effect::kEventFlagNotEmpty;
using aidl::android::hardware::audio::effect::kReopenSupportedVersion;
@@ -31,13 +34,45 @@
using ::android::hardware::EventFlag;
extern "C" binder_exception_t destroyEffect(const std::shared_ptr<IEffect>& instanceSp) {
- State state;
- ndk::ScopedAStatus status = instanceSp->getState(&state);
- if (!status.isOk() || State::INIT != state) {
+ if (!instanceSp) {
+ LOG(ERROR) << __func__ << " nullptr";
+ return EX_ILLEGAL_ARGUMENT;
+ }
+
+ Descriptor desc;
+ ndk::ScopedAStatus status = instanceSp->getDescriptor(&desc);
+ if (!status.isOk()) {
LOG(ERROR) << __func__ << " instance " << instanceSp.get()
+ << " failed to get descriptor, status: " << status.getDescription();
+ return EX_ILLEGAL_STATE;
+ }
+
+ State state;
+ status = instanceSp->getState(&state);
+ if (!status.isOk()) {
+ LOG(ERROR) << __func__ << " " << desc.common.name << " instance " << instanceSp.get()
<< " in state: " << toString(state) << ", status: " << status.getDescription();
return EX_ILLEGAL_STATE;
}
+
+ int effectVersion = 0;
+ if (!instanceSp->getInterfaceVersion(&effectVersion).isOk()) {
+ LOG(WARNING) << __func__ << " " << desc.common.name << " failed to get interface version";
+ }
+
+ if (effectVersion < kDestroyAnyStateSupportedVersion) {
+ if (State::INIT != state) {
+ LOG(ERROR) << __func__ << " " << desc.common.name << " can not destroy instance "
+ << instanceSp.get() << " in state: " << toString(state);
+ return EX_ILLEGAL_STATE;
+ }
+ } else {
+ instanceSp->command(CommandId::RESET);
+ instanceSp->close();
+ }
+
+ LOG(DEBUG) << __func__ << " " << desc.common.name << " instance " << instanceSp.get()
+ << " destroyed";
return EX_NONE;
}
diff --git a/audio/aidl/default/config/audioPolicy/api/current.txt b/audio/aidl/default/config/audioPolicy/api/current.txt
index 7fce8fb..1249a09 100644
--- a/audio/aidl/default/config/audioPolicy/api/current.txt
+++ b/audio/aidl/default/config/audioPolicy/api/current.txt
@@ -223,6 +223,18 @@
enum_constant public static final android.audio.policy.configuration.AudioFormat AUDIO_FORMAT_FLAC;
enum_constant public static final android.audio.policy.configuration.AudioFormat AUDIO_FORMAT_HE_AAC_V1;
enum_constant public static final android.audio.policy.configuration.AudioFormat AUDIO_FORMAT_HE_AAC_V2;
+ enum_constant public static final android.audio.policy.configuration.AudioFormat AUDIO_FORMAT_IAMF_BASE_AAC;
+ enum_constant public static final android.audio.policy.configuration.AudioFormat AUDIO_FORMAT_IAMF_BASE_ENHANCED_AAC;
+ enum_constant public static final android.audio.policy.configuration.AudioFormat AUDIO_FORMAT_IAMF_BASE_ENHANCED_FLAC;
+ enum_constant public static final android.audio.policy.configuration.AudioFormat AUDIO_FORMAT_IAMF_BASE_ENHANCED_OPUS;
+ enum_constant public static final android.audio.policy.configuration.AudioFormat AUDIO_FORMAT_IAMF_BASE_ENHANCED_PCM;
+ enum_constant public static final android.audio.policy.configuration.AudioFormat AUDIO_FORMAT_IAMF_BASE_FLAC;
+ enum_constant public static final android.audio.policy.configuration.AudioFormat AUDIO_FORMAT_IAMF_BASE_OPUS;
+ enum_constant public static final android.audio.policy.configuration.AudioFormat AUDIO_FORMAT_IAMF_BASE_PCM;
+ enum_constant public static final android.audio.policy.configuration.AudioFormat AUDIO_FORMAT_IAMF_SIMPLE_AAC;
+ enum_constant public static final android.audio.policy.configuration.AudioFormat AUDIO_FORMAT_IAMF_SIMPLE_FLAC;
+ enum_constant public static final android.audio.policy.configuration.AudioFormat AUDIO_FORMAT_IAMF_SIMPLE_OPUS;
+ enum_constant public static final android.audio.policy.configuration.AudioFormat AUDIO_FORMAT_IAMF_SIMPLE_PCM;
enum_constant public static final android.audio.policy.configuration.AudioFormat AUDIO_FORMAT_IEC60958;
enum_constant public static final android.audio.policy.configuration.AudioFormat AUDIO_FORMAT_IEC61937;
enum_constant public static final android.audio.policy.configuration.AudioFormat AUDIO_FORMAT_LC3;
diff --git a/audio/aidl/default/config/audioPolicy/audio_policy_configuration.xsd b/audio/aidl/default/config/audioPolicy/audio_policy_configuration.xsd
index 1f90313..8adac8c 100644
--- a/audio/aidl/default/config/audioPolicy/audio_policy_configuration.xsd
+++ b/audio/aidl/default/config/audioPolicy/audio_policy_configuration.xsd
@@ -417,6 +417,18 @@
<xs:enumeration value="AUDIO_FORMAT_APTX_ADAPTIVE_R4"/>
<xs:enumeration value="AUDIO_FORMAT_DTS_HD_MA"/>
<xs:enumeration value="AUDIO_FORMAT_DTS_UHD_P2"/>
+ <xs:enumeration value="AUDIO_FORMAT_IAMF_SIMPLE_OPUS"/>
+ <xs:enumeration value="AUDIO_FORMAT_IAMF_SIMPLE_AAC"/>
+ <xs:enumeration value="AUDIO_FORMAT_IAMF_SIMPLE_PCM"/>
+ <xs:enumeration value="AUDIO_FORMAT_IAMF_SIMPLE_FLAC"/>
+ <xs:enumeration value="AUDIO_FORMAT_IAMF_BASE_OPUS"/>
+ <xs:enumeration value="AUDIO_FORMAT_IAMF_BASE_AAC"/>
+ <xs:enumeration value="AUDIO_FORMAT_IAMF_BASE_PCM"/>
+ <xs:enumeration value="AUDIO_FORMAT_IAMF_BASE_FLAC"/>
+ <xs:enumeration value="AUDIO_FORMAT_IAMF_BASE_ENHANCED_OPUS"/>
+ <xs:enumeration value="AUDIO_FORMAT_IAMF_BASE_ENHANCED_AAC"/>
+ <xs:enumeration value="AUDIO_FORMAT_IAMF_BASE_ENHANCED_PCM"/>
+ <xs:enumeration value="AUDIO_FORMAT_IAMF_BASE_ENHANCED_FLAC"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="extendableAudioFormat">
diff --git a/audio/aidl/vts/VtsHalAudioEffectTargetTest.cpp b/audio/aidl/vts/VtsHalAudioEffectTargetTest.cpp
index d23bdc9..5b78981 100644
--- a/audio/aidl/vts/VtsHalAudioEffectTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalAudioEffectTargetTest.cpp
@@ -42,6 +42,7 @@
using aidl::android::hardware::audio::effect::Flags;
using aidl::android::hardware::audio::effect::IEffect;
using aidl::android::hardware::audio::effect::IFactory;
+using aidl::android::hardware::audio::effect::kDestroyAnyStateSupportedVersion;
using aidl::android::hardware::audio::effect::Parameter;
using aidl::android::hardware::audio::effect::State;
using aidl::android::media::audio::common::AudioDeviceDescription;
@@ -316,28 +317,39 @@
ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect));
}
-// Expect EX_ILLEGAL_STATE if the effect instance is not in a proper state to be destroyed.
+// Expect EX_ILLEGAL_STATE if the effect instance is not in a proper state to be destroyed before
+// `kDestroyAnyStateSupportedVersion`.
+// For any version after `kDestroyAnyStateSupportedVersion`, expect `destroy` to always success.
TEST_P(AudioEffectTest, DestroyOpenEffects) {
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
ASSERT_NO_FATAL_FAILURE(open(mEffect));
- ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect, EX_ILLEGAL_STATE));
-
- // cleanup
- ASSERT_NO_FATAL_FAILURE(close(mEffect));
- ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect));
+ if (mVersion < kDestroyAnyStateSupportedVersion) {
+ ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect, EX_ILLEGAL_STATE));
+ // cleanup
+ ASSERT_NO_FATAL_FAILURE(close(mEffect));
+ ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect));
+ } else {
+ ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect));
+ }
}
-// Expect EX_ILLEGAL_STATE if the effect instance is not in a proper state to be destroyed.
+// Expect EX_ILLEGAL_STATE if the effect instance is not in a proper state to be destroyed before
+// `kDestroyAnyStateSupportedVersion`.
+// For any version after `kDestroyAnyStateSupportedVersion`, expect `destroy` to always success.
TEST_P(AudioEffectTest, DestroyProcessingEffects) {
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
ASSERT_NO_FATAL_FAILURE(open(mEffect));
ASSERT_NO_FATAL_FAILURE(command(mEffect, CommandId::START));
- ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect, EX_ILLEGAL_STATE));
- // cleanup
- ASSERT_NO_FATAL_FAILURE(command(mEffect, CommandId::STOP));
- ASSERT_NO_FATAL_FAILURE(close(mEffect));
- ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect));
+ if (mVersion < kDestroyAnyStateSupportedVersion) {
+ ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect, EX_ILLEGAL_STATE));
+ // cleanup
+ ASSERT_NO_FATAL_FAILURE(command(mEffect, CommandId::STOP));
+ ASSERT_NO_FATAL_FAILURE(close(mEffect));
+ ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect));
+ } else {
+ ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect));
+ }
}
TEST_P(AudioEffectTest, NormalSequenceStates) {
diff --git a/automotive/audiocontrol/aidl/default/converter/src/CarAudioConfigurationXmlConverter.cpp b/automotive/audiocontrol/aidl/default/converter/src/CarAudioConfigurationXmlConverter.cpp
index d43b595..206ce0c 100644
--- a/automotive/audiocontrol/aidl/default/converter/src/CarAudioConfigurationXmlConverter.cpp
+++ b/automotive/audiocontrol/aidl/default/converter/src/CarAudioConfigurationXmlConverter.cpp
@@ -645,11 +645,9 @@
bool parseVolumeGroupActivationEntry(const xsd::ActivationVolumeConfigEntryType& xsdEntry,
api::VolumeActivationConfigurationEntry& entry) {
if (!xsdEntry.hasInvocationType()) {
- LOG(ERROR) << __func__ << " Activation config entry missing invocation type";
- return false;
- }
-
- if (!parseVolumeActivationType(xsdEntry.getInvocationType(), entry.type)) {
+ // Legacy file had default invocation type as on playback changed
+ entry.type = api::VolumeInvocationType::ON_PLAYBACK_CHANGED;
+ } else if (!parseVolumeActivationType(xsdEntry.getInvocationType(), entry.type)) {
LOG(ERROR) << __func__ << " Could not parse configuration entry type";
return false;
}
diff --git a/automotive/audiocontrol/aidl/vts/VtsHalAudioControlTargetTest.cpp b/automotive/audiocontrol/aidl/vts/VtsHalAudioControlTargetTest.cpp
index c01c0d6..6781a81 100644
--- a/automotive/audiocontrol/aidl/vts/VtsHalAudioControlTargetTest.cpp
+++ b/automotive/audiocontrol/aidl/vts/VtsHalAudioControlTargetTest.cpp
@@ -149,7 +149,9 @@
return false;
}
if (groupDevices.contains(address)) {
- message = " Audio device address can not repeat in the same volume group";
+ message =
+ " Audio device address can not repeat in the same volume group or within audio"
+ " zone configuration if not using configurable audio policy engine";
return false;
}
groupDevices.insert(address);
@@ -196,7 +198,8 @@
void validateVolumeGroupInfo(const AudioZoneConfig& audioZoneConfig,
const VolumeGroupConfig& volumeGroupConfig,
- const AudioDeviceConfiguration& deviceConfig) {
+ const AudioDeviceConfiguration& deviceConfig,
+ std::set<std::string>& groupDevices) {
std::string zoneConfigName = testutils::toAlphaNumeric(ToString(audioZoneConfig.name));
std::string volumeGroupName = testutils::toAlphaNumeric(ToString(volumeGroupConfig.name));
std::string volumeGroupInfo =
@@ -209,7 +212,6 @@
EXPECT_FALSE(volumeGroupConfig.name.empty())
<< volumeGroupInfo << " must have a non-empty volume name";
}
- std::set<std::string> groupDevices;
for (const auto& audioRoute : volumeGroupConfig.carAudioRoutes) {
std::string routeMessage;
EXPECT_TRUE(hasValidAudioRoute(audioRoute, routeMessage, groupDevices))
@@ -254,6 +256,7 @@
std::set<std::string> contextInfoNames;
EXPECT_FALSE(audioZoneConfig.volumeGroups.empty())
<< "Volume groups for zone config " << zoneConfigName.c_str();
+ std::set<std::string> groupDevices;
for (const auto& volumeGroup : audioZoneConfig.volumeGroups) {
ALOGI("Zone config name %s volume group test %s", zoneConfigName.c_str(),
ToString(volumeGroup.name).c_str());
@@ -264,7 +267,11 @@
<< "Context " << context << " repeats in zone config " << zoneConfigName;
contextInfoNames.insert(context);
}
- validateVolumeGroupInfo(audioZoneConfig, volumeGroup, deviceConfig);
+ // Configurable audio policy engine can share devices among volume groups
+ if (deviceConfig.routingConfig == CONFIGURABLE_AUDIO_ENGINE_ROUTING) {
+ groupDevices.clear();
+ }
+ validateVolumeGroupInfo(audioZoneConfig, volumeGroup, deviceConfig, groupDevices);
}
const auto& audioZoneContexts = carAudioZone.audioZoneContext.audioContextInfos;
std::map<std::string, AudioZoneContextInfo> infoNameToInfo;
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/ValueRange.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/ValueRange.aidl
deleted file mode 100644
index 816a6a8..0000000
--- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/ValueRange.aidl
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2024 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.hardware.automotive.vehicle;
-
-import android.hardware.automotive.vehicle.RawPropValues;
-
-/**
- * Represents the value range for a vehicle property.
- *
- * This applies for the values read from VHAL and the values sent to VHAL.
- *
- * If the value range differs, this is the super set.
- */
-@VintfStability
-@JavaDerive(equals=true, toString=true)
-@RustDerive(Clone=true)
-parcelable ValueRange {
- /**
- * The currently specified minimum value for the property.
- *
- * {@code null} if not specified.
- */
- @nullable RawPropValues minValue;
-
- /**
- * The currently specified maximum value for the property.
- *
- * {@code null} if not specified.
- */
- @nullable RawPropValues maxValue;
-
- /**
- * The currently specified supported values for the property.
- *
- * If the value type is int32, int64 or float, the returned list must be
- * sorted in ascending order.
- *
- * {@code null} if not specified.
- */
- @nullable List<RawPropValues> supportedValues;
-}
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BroadcastCapability.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BroadcastCapability.aidl
index 58710ef..2872362 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BroadcastCapability.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BroadcastCapability.aidl
@@ -38,6 +38,7 @@
android.hardware.bluetooth.audio.AudioLocation supportedChannel;
int channelCountPerStream;
android.hardware.bluetooth.audio.BroadcastCapability.LeAudioCodecCapabilities leAudioCodecCapabilities;
+ @nullable android.hardware.bluetooth.audio.CodecSpecificConfigurationLtv.AudioChannelAllocation audioLocation;
@VintfStability
parcelable VendorCapabilities {
ParcelableHolder extension;
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecSpecificConfigurationLtv.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecSpecificConfigurationLtv.aidl
index be79b0d..97fcd1f 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecSpecificConfigurationLtv.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecSpecificConfigurationLtv.aidl
@@ -92,6 +92,7 @@
const int FRONT_RIGHT_WIDE = 0x02000000;
const int LEFT_SURROUND = 0x04000000;
const int RIGHT_SURROUND = 0x08000000;
+ const int MONO = 0x00000000;
}
parcelable OctetsPerCodecFrame {
int value;
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/UnicastCapability.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/UnicastCapability.aidl
index 481e2ac..6ed0e56 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/UnicastCapability.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/UnicastCapability.aidl
@@ -39,6 +39,7 @@
int deviceCount;
int channelCountPerDevice;
android.hardware.bluetooth.audio.UnicastCapability.LeAudioCodecCapabilities leAudioCodecCapabilities;
+ @nullable android.hardware.bluetooth.audio.CodecSpecificConfigurationLtv.AudioChannelAllocation audioLocation;
@VintfStability
parcelable VendorCapabilities {
ParcelableHolder extension;
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BroadcastCapability.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BroadcastCapability.aidl
index f1301fb..db3c10e 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BroadcastCapability.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BroadcastCapability.aidl
@@ -17,6 +17,7 @@
package android.hardware.bluetooth.audio;
import android.hardware.bluetooth.audio.AudioLocation;
+import android.hardware.bluetooth.audio.CodecSpecificConfigurationLtv.AudioChannelAllocation;
import android.hardware.bluetooth.audio.CodecType;
import android.hardware.bluetooth.audio.Lc3Capabilities;
@@ -35,8 +36,11 @@
@nullable VendorCapabilities[] vendorCapabillities;
}
CodecType codecType;
+ // @deprecated use audioLocation if present.
AudioLocation supportedChannel;
// Supported channel count for each stream
int channelCountPerStream;
LeAudioCodecCapabilities leAudioCodecCapabilities;
+ // The new audio location type, replacing supportedChannel
+ @nullable AudioChannelAllocation audioLocation;
}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecSpecificConfigurationLtv.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecSpecificConfigurationLtv.aidl
index 5e32e5e..2835325 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecSpecificConfigurationLtv.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecSpecificConfigurationLtv.aidl
@@ -47,6 +47,7 @@
}
parcelable AudioChannelAllocation {
+ // @deprecated use MONO instead.
const int NOT_ALLOWED = 0x00000000;
const int FRONT_LEFT = 0x00000001;
const int FRONT_RIGHT = 0x00000002;
@@ -76,6 +77,7 @@
const int FRONT_RIGHT_WIDE = 0x02000000;
const int LEFT_SURROUND = 0x04000000;
const int RIGHT_SURROUND = 0x08000000;
+ const int MONO = 0x00000000;
// Bit mask of Audio Locations
int bitmask;
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/UnicastCapability.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/UnicastCapability.aidl
index 8583221..9f33672 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/UnicastCapability.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/UnicastCapability.aidl
@@ -18,6 +18,7 @@
import android.hardware.bluetooth.audio.AptxAdaptiveLeCapabilities;
import android.hardware.bluetooth.audio.AudioLocation;
+import android.hardware.bluetooth.audio.CodecSpecificConfigurationLtv.AudioChannelAllocation;
import android.hardware.bluetooth.audio.CodecType;
import android.hardware.bluetooth.audio.Lc3Capabilities;
import android.hardware.bluetooth.audio.OpusCapabilities;
@@ -39,10 +40,13 @@
OpusCapabilities opusCapabilities;
}
CodecType codecType;
+ // @deprecated use audioLocation if present.
AudioLocation supportedChannel;
// The number of connected device
int deviceCount;
// Supported channel count for each device
int channelCountPerDevice;
LeAudioCodecCapabilities leAudioCodecCapabilities;
+ // The new audio location type, replacing supportedChannel
+ @nullable AudioChannelAllocation audioLocation;
}
diff --git a/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.cpp b/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.cpp
index a10e0a6..18fc4b2 100644
--- a/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.cpp
+++ b/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.cpp
@@ -534,7 +534,8 @@
direction_configurations,
const std::vector<std::optional<AseDirectionRequirement>>& requirements,
std::optional<std::vector<std::optional<AseDirectionConfiguration>>>&
- valid_direction_configurations) {
+ valid_direction_configurations,
+ bool isExact) {
if (!direction_configurations.has_value()) return;
if (!valid_direction_configurations.has_value()) {
@@ -542,55 +543,93 @@
std::vector<std::optional<AseDirectionConfiguration>>();
}
- // Exact matching process
- // Need to respect the number of device
- for (int i = 0; i < requirements.size(); ++i) {
- auto requirement = requirements[i];
- auto direction_configuration = direction_configurations.value()[i];
- if (!direction_configuration.has_value()) {
- valid_direction_configurations = std::nullopt;
- return;
- }
- auto cfg = direction_configuration.value();
- if (!filterMatchedAseConfiguration(cfg.aseConfiguration,
- requirement.value().aseConfiguration)) {
- valid_direction_configurations = std::nullopt;
- return; // No way to match
- }
- // For exact match, we require this direction to have the same allocation.
- // If stereo, need stereo.
- // If mono, need mono (modified to the correct required allocation)
- auto req_allocation_bitmask = getLeAudioAseConfigurationAllocationBitmask(
- requirement.value().aseConfiguration);
- int req_channel_count = getCountFromBitmask(req_allocation_bitmask);
- int cfg_bitmask =
- getLeAudioAseConfigurationAllocationBitmask(cfg.aseConfiguration);
- int cfg_channel_count = getCountFromBitmask(cfg_bitmask);
- if (req_channel_count <= 1) {
- // MONO case, is a match if also mono, modify to the same allocation
- if (cfg_channel_count > 1) {
+ if (isExact) {
+ // Exact matching process
+ // Need to respect the number of device
+ for (int i = 0; i < requirements.size(); ++i) {
+ auto requirement = requirements[i];
+ auto direction_configuration = direction_configurations.value()[i];
+ if (!direction_configuration.has_value()) {
valid_direction_configurations = std::nullopt;
- return; // Not a match
+ return;
}
- // Modify the bitmask to be the same as the requirement
- for (auto& codec_cfg : cfg.aseConfiguration.codecConfiguration) {
- if (codec_cfg.getTag() ==
- CodecSpecificConfigurationLtv::Tag::audioChannelAllocation) {
- codec_cfg
- .get<CodecSpecificConfigurationLtv::Tag::audioChannelAllocation>()
- .bitmask = req_allocation_bitmask;
- break;
+ auto cfg = direction_configuration.value();
+ if (!filterMatchedAseConfiguration(
+ cfg.aseConfiguration, requirement.value().aseConfiguration)) {
+ valid_direction_configurations = std::nullopt;
+ return; // No way to match
+ }
+ // For exact match, we require this direction to have the same allocation.
+ // If stereo, need stereo.
+ // If mono, need mono (modified to the correct required allocation)
+ auto req_allocation_bitmask = getLeAudioAseConfigurationAllocationBitmask(
+ requirement.value().aseConfiguration);
+ int req_channel_count = getCountFromBitmask(req_allocation_bitmask);
+ int cfg_bitmask =
+ getLeAudioAseConfigurationAllocationBitmask(cfg.aseConfiguration);
+ int cfg_channel_count = getCountFromBitmask(cfg_bitmask);
+ if (req_channel_count <= 1) {
+ // MONO case, is a match if also mono, modify to the same allocation
+ if (cfg_channel_count > 1) {
+ valid_direction_configurations = std::nullopt;
+ return; // Not a match
+ }
+ // Modify the bitmask to be the same as the requirement
+ for (auto& codec_cfg : cfg.aseConfiguration.codecConfiguration) {
+ if (codec_cfg.getTag() ==
+ CodecSpecificConfigurationLtv::Tag::audioChannelAllocation) {
+ codec_cfg
+ .get<CodecSpecificConfigurationLtv::Tag::
+ audioChannelAllocation>()
+ .bitmask = req_allocation_bitmask;
+ break;
+ }
+ }
+ } else {
+ // STEREO case, is a match if same allocation
+ if (req_allocation_bitmask != cfg_bitmask) {
+ valid_direction_configurations = std::nullopt;
+ return; // Not a match
}
}
- } else {
- // STEREO case, is a match if same allocation
- if (req_allocation_bitmask != cfg_bitmask) {
+ // Push to list if valid
+ valid_direction_configurations.value().push_back(cfg);
+ }
+ } else {
+ // Loose matching process
+ for (auto& requirement : requirements) {
+ if (!requirement.has_value()) continue;
+ auto req_allocation_bitmask = getLeAudioAseConfigurationAllocationBitmask(
+ requirement.value().aseConfiguration);
+ auto req_channel_count = getCountFromBitmask(req_allocation_bitmask);
+
+ auto temp = std::vector<AseDirectionConfiguration>();
+
+ for (auto direction_configuration : direction_configurations.value()) {
+ if (!direction_configuration.has_value()) continue;
+ if (!filterMatchedAseConfiguration(
+ direction_configuration.value().aseConfiguration,
+ requirement.value().aseConfiguration))
+ continue;
+ // Valid if match any requirement.
+ temp.push_back(direction_configuration.value());
+ }
+
+ // Get the best matching config based on channel allocation
+ auto total_cfg_channel_count = 0;
+ auto req_valid_configs = getValidConfigurationsFromAllocation(
+ req_allocation_bitmask, temp, isExact);
+ // Count and check required channel counts
+ for (auto& cfg : req_valid_configs) {
+ total_cfg_channel_count += getCountFromBitmask(
+ getLeAudioAseConfigurationAllocationBitmask(cfg.aseConfiguration));
+ valid_direction_configurations.value().push_back(cfg);
+ }
+ if (total_cfg_channel_count != req_channel_count) {
valid_direction_configurations = std::nullopt;
- return; // Not a match
+ return;
}
}
- // Push to list if valid
- valid_direction_configurations.value().push_back(cfg);
}
}
@@ -650,8 +689,8 @@
std::optional<LeAudioAseConfigurationSetting>
LeAudioOffloadAudioProvider::getRequirementMatchedAseConfigurationSettings(
IBluetoothAudioProvider::LeAudioAseConfigurationSetting& setting,
- const IBluetoothAudioProvider::LeAudioConfigurationRequirement&
- requirement) {
+ const IBluetoothAudioProvider::LeAudioConfigurationRequirement& requirement,
+ bool isExact) {
// Create a new LeAudioAseConfigurationSetting to return
// Make context the same as the requirement
LeAudioAseConfigurationSetting filtered_setting{
@@ -664,25 +703,27 @@
// is the number of device.
// The exact matching process is as follow:
- // 1. Setting direction has the same number of cfg (ignore when null require)
+ // 1. Setting direction has the same number of cfg (ignore when null
+ // require)
// 2. For each index, it's a 1-1 filter / mapping.
+ if (isExact) {
+ if (requirement.sinkAseRequirement.has_value() &&
+ requirement.sinkAseRequirement.value().size() !=
+ setting.sinkAseConfiguration.value().size()) {
+ return std::nullopt;
+ }
- if (requirement.sinkAseRequirement.has_value() &&
- requirement.sinkAseRequirement.value().size() !=
- setting.sinkAseConfiguration.value().size()) {
- return std::nullopt;
- }
-
- if (requirement.sourceAseRequirement.has_value() &&
- requirement.sourceAseRequirement.value().size() !=
- setting.sourceAseConfiguration.value().size()) {
- return std::nullopt;
+ if (requirement.sourceAseRequirement.has_value() &&
+ requirement.sourceAseRequirement.value().size() !=
+ setting.sourceAseConfiguration.value().size()) {
+ return std::nullopt;
+ }
}
if (requirement.sinkAseRequirement.has_value()) {
filterRequirementAseDirectionConfiguration(
setting.sinkAseConfiguration, requirement.sinkAseRequirement.value(),
- filtered_setting.sinkAseConfiguration);
+ filtered_setting.sinkAseConfiguration, isExact);
if (!filtered_setting.sinkAseConfiguration.has_value()) {
return std::nullopt;
}
@@ -692,7 +733,7 @@
filterRequirementAseDirectionConfiguration(
setting.sourceAseConfiguration,
requirement.sourceAseRequirement.value(),
- filtered_setting.sourceAseConfiguration);
+ filtered_setting.sourceAseConfiguration, isExact);
if (!filtered_setting.sourceAseConfiguration.has_value()) {
return std::nullopt;
}
@@ -706,9 +747,10 @@
std::vector<IBluetoothAudioProvider::LeAudioAseConfigurationSetting>&
matched_ase_configuration_settings,
const IBluetoothAudioProvider::LeAudioConfigurationRequirement& requirement,
- bool isMatchContext) {
+ bool isMatchContext, bool isExact) {
LOG(INFO) << __func__ << ": Trying to match for the requirement "
- << requirement.toString() << ", match context = " << isMatchContext;
+ << requirement.toString() << ", match context = " << isMatchContext
+ << ", match exact = " << isExact;
for (auto& setting : matched_ase_configuration_settings) {
// Try to match context in metadata.
if (isMatchContext) {
@@ -720,7 +762,8 @@
}
auto filtered_ase_configuration_setting =
- getRequirementMatchedAseConfigurationSettings(setting, requirement);
+ getRequirementMatchedAseConfigurationSettings(setting, requirement,
+ isExact);
if (filtered_ase_configuration_setting.has_value()) {
LOG(INFO) << __func__ << ": Result found: "
<< getSettingOutputString(
@@ -811,26 +854,30 @@
// Matching priority list:
// Preferred context - exact match with allocation
+ // Preferred context - loose match with allocation
// Any context - exact match with allocation
- auto matched_setting_with_context = matchWithRequirement(
- matched_ase_configuration_settings, requirement, true);
- if (matched_setting_with_context.has_value()) {
- result.push_back(matched_setting_with_context.value());
- } else {
- auto matched_setting = matchWithRequirement(
- matched_ase_configuration_settings, requirement, false);
- if (matched_setting.has_value()) {
- result.push_back(matched_setting.value());
- } else {
- // Cannot find a match for this requirement
- // Immediately return
- LOG(ERROR)
- << __func__
- << ": Cannot find any match for this requirement, exitting...";
- result.clear();
- *_aidl_return = result;
- return ndk::ScopedAStatus::ok();
+ // Any context - loose match with allocation
+ bool found = false;
+ for (bool match_context : {true, false}) {
+ for (bool match_exact : {true, false}) {
+ auto matched_setting =
+ matchWithRequirement(matched_ase_configuration_settings,
+ requirement, match_context, match_exact);
+ if (matched_setting.has_value()) {
+ result.push_back(matched_setting.value());
+ found = true;
+ break;
+ }
}
+ if (found) break;
+ }
+
+ if (!found) {
+ LOG(ERROR) << __func__
+ << ": Cannot find any match for this requirement, exitting...";
+ result.clear();
+ *_aidl_return = result;
+ return ndk::ScopedAStatus::ok();
}
}
diff --git a/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.h b/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.h
index 798f183..3a82b73 100644
--- a/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.h
+++ b/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.h
@@ -139,7 +139,8 @@
direction_configurations,
const std::vector<std::optional<AseDirectionRequirement>>& requirements,
std::optional<std::vector<std::optional<AseDirectionConfiguration>>>&
- valid_direction_configurations);
+ valid_direction_configurations,
+ bool isExact);
std::optional<LeAudioAseConfigurationSetting>
getCapabilitiesMatchedAseConfigurationSettings(
IBluetoothAudioProvider::LeAudioAseConfigurationSetting& setting,
@@ -149,7 +150,8 @@
getRequirementMatchedAseConfigurationSettings(
IBluetoothAudioProvider::LeAudioAseConfigurationSetting& setting,
const IBluetoothAudioProvider::LeAudioConfigurationRequirement&
- requirement);
+ requirement,
+ bool isExact);
bool isMatchedQosRequirement(LeAudioAseQosConfiguration setting_qos,
AseQosDirectionRequirement requirement_qos);
std::optional<LeAudioBroadcastConfigurationSetting>
@@ -173,7 +175,7 @@
matched_ase_configuration_settings,
const IBluetoothAudioProvider::LeAudioConfigurationRequirement&
requirements,
- bool isMatchContext);
+ bool isMatchContext, bool isExact);
};
class LeAudioOffloadOutputAudioProvider : public LeAudioOffloadAudioProvider {
diff --git a/bluetooth/audio/utils/Android.bp b/bluetooth/audio/utils/Android.bp
index d931c4d..d4968a8 100644
--- a/bluetooth/audio/utils/Android.bp
+++ b/bluetooth/audio/utils/Android.bp
@@ -90,13 +90,15 @@
cc_test {
name: "BluetoothLeAudioCodecsProviderTest",
- defaults: [
- "latest_android_hardware_bluetooth_audio_ndk_shared",
- ],
srcs: [
"aidl_session/BluetoothLeAudioCodecsProvider.cpp",
"aidl_session/BluetoothLeAudioCodecsProviderTest.cpp",
],
+ defaults: [
+ "latest_android_hardware_audio_common_ndk_static",
+ "latest_android_hardware_bluetooth_audio_ndk_static",
+ "latest_android_media_audio_common_types_ndk_static",
+ ],
header_libs: [
"libxsdc-utils",
],
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothLeAudioAseConfigurationSettingProvider.cpp b/bluetooth/audio/utils/aidl_session/BluetoothLeAudioAseConfigurationSettingProvider.cpp
index 8475d39..07e4997 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothLeAudioAseConfigurationSettingProvider.cpp
+++ b/bluetooth/audio/utils/aidl_session/BluetoothLeAudioAseConfigurationSettingProvider.cpp
@@ -95,7 +95,7 @@
constexpr uint8_t kLeAudioCodecFrameDur20000us = 0x02;
/* Audio Allocations */
-constexpr uint32_t kLeAudioLocationNotAllowed = 0x00000000;
+constexpr uint32_t kLeAudioLocationMonoAudio = 0x00000000;
constexpr uint32_t kLeAudioLocationFrontLeft = 0x00000001;
constexpr uint32_t kLeAudioLocationFrontRight = 0x00000002;
constexpr uint32_t kLeAudioLocationFrontCenter = 0x00000004;
@@ -178,8 +178,8 @@
/* Helper map for matching various audio channel allocation notations */
std::map<uint32_t, uint32_t> audio_channel_allocation_map = {
- {kLeAudioLocationNotAllowed,
- CodecSpecificConfigurationLtv::AudioChannelAllocation::NOT_ALLOWED},
+ {kLeAudioLocationMonoAudio,
+ CodecSpecificConfigurationLtv::AudioChannelAllocation::MONO},
{kLeAudioLocationFrontLeft,
CodecSpecificConfigurationLtv::AudioChannelAllocation::FRONT_LEFT},
{kLeAudioLocationFrontRight,
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothLeAudioCodecsProvider.cpp b/bluetooth/audio/utils/aidl_session/BluetoothLeAudioCodecsProvider.cpp
index 473777c..59c43a4 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothLeAudioCodecsProvider.cpp
+++ b/bluetooth/audio/utils/aidl_session/BluetoothLeAudioCodecsProvider.cpp
@@ -119,19 +119,36 @@
// Mapping octetsPerCodecFrame to bitdepth for easier comparison.
transport.bitdepth.push_back(codec_config.getOctetsPerCodecFrame());
transport.frameDurationUs.push_back(codec_config.getFrameDurationUs());
- switch (strategy_config.getAudioLocation()) {
- case setting::AudioLocation::MONO:
+ if (strategy_config.hasAudioLocation()) {
+ switch (strategy_config.getAudioLocation()) {
+ case setting::AudioLocation::MONO:
+ if (strategy_config_channel_count == 1)
+ transport.channelMode.push_back(ChannelMode::MONO);
+ else
+ transport.channelMode.push_back(ChannelMode::DUALMONO);
+ break;
+ case setting::AudioLocation::STEREO:
+ transport.channelMode.push_back(ChannelMode::STEREO);
+ break;
+ default:
+ transport.channelMode.push_back(ChannelMode::UNKNOWN);
+ break;
+ }
+ } else if (strategy_config.hasAudioChannelAllocation()) {
+ auto count =
+ std::bitset<32>(strategy_config.getAudioChannelAllocation()).count();
+ if (count <= 1) {
if (strategy_config_channel_count == 1)
transport.channelMode.push_back(ChannelMode::MONO);
else
transport.channelMode.push_back(ChannelMode::DUALMONO);
- break;
- case setting::AudioLocation::STEREO:
+ } else if (count == 2) {
transport.channelMode.push_back(ChannelMode::STEREO);
- break;
- default:
+ } else {
transport.channelMode.push_back(ChannelMode::UNKNOWN);
- break;
+ }
+ } else {
+ transport.channelMode.push_back(ChannelMode::UNKNOWN);
}
}
@@ -336,8 +353,12 @@
for (const auto& scenario : supported_scenarios) {
UnicastCapability unicast_encode_capability =
GetUnicastCapability(scenario.getEncode());
+ LOG(INFO) << __func__ << ": Unicast capability encode = "
+ << unicast_encode_capability.toString();
UnicastCapability unicast_decode_capability =
GetUnicastCapability(scenario.getDecode());
+ LOG(INFO) << __func__ << ": Unicast capability decode = "
+ << unicast_decode_capability.toString();
BroadcastCapability broadcast_capability = {.codecType =
CodecType::UNKNOWN};
@@ -384,22 +405,36 @@
return {.codecType = CodecType::UNKNOWN};
}
+ // Populate audio location
+ AudioLocation audio_location = AudioLocation::UNKNOWN;
+ if (strategy_configuration_iter->second.hasAudioLocation()) {
+ audio_location = GetAudioLocation(
+ strategy_configuration_iter->second.getAudioLocation());
+ }
+
+ // Populate audio channel allocation
+ std::optional<CodecSpecificConfigurationLtv::AudioChannelAllocation>
+ audio_channel_allocation = std::nullopt;
+ if (strategy_configuration_iter->second.hasAudioChannelAllocation()) {
+ LOG(INFO) << __func__ << ": has allocation";
+ CodecSpecificConfigurationLtv::AudioChannelAllocation tmp;
+ tmp.bitmask =
+ strategy_configuration_iter->second.getAudioChannelAllocation();
+ audio_channel_allocation = tmp;
+ }
+
CodecType codec_type =
GetCodecType(codec_configuration_iter->second.getCodec());
if (codec_type == CodecType::LC3) {
return ComposeUnicastCapability(
- codec_type,
- GetAudioLocation(
- strategy_configuration_iter->second.getAudioLocation()),
+ codec_type, audio_location, audio_channel_allocation,
strategy_configuration_iter->second.getConnectedDevice(),
strategy_configuration_iter->second.getChannelCount(),
ComposeLc3Capability(codec_configuration_iter->second));
} else if (codec_type == CodecType::APTX_ADAPTIVE_LE ||
codec_type == CodecType::APTX_ADAPTIVE_LEX) {
return ComposeUnicastCapability(
- codec_type,
- GetAudioLocation(
- strategy_configuration_iter->second.getAudioLocation()),
+ codec_type, audio_location, audio_channel_allocation,
strategy_configuration_iter->second.getConnectedDevice(),
strategy_configuration_iter->second.getChannelCount(),
ComposeAptxAdaptiveLeCapability(codec_configuration_iter->second));
@@ -435,11 +470,27 @@
std::vector<std::optional<Lc3Capabilities>> bcastLc3Cap(
1, std::optional(ComposeLc3Capability(codec_configuration_iter->second)));
+ // Populate audio location
+ AudioLocation audio_location = AudioLocation::UNKNOWN;
+ if (strategy_configuration_iter->second.hasAudioLocation()) {
+ audio_location = GetAudioLocation(
+ strategy_configuration_iter->second.getAudioLocation());
+ }
+
+ // Populate audio channel allocation
+ std::optional<CodecSpecificConfigurationLtv::AudioChannelAllocation>
+ audio_channel_allocation = std::nullopt;
+ if (strategy_configuration_iter->second.hasAudioChannelAllocation()) {
+ LOG(INFO) << __func__ << ": has allocation";
+ CodecSpecificConfigurationLtv::AudioChannelAllocation tmp;
+ tmp.bitmask =
+ strategy_configuration_iter->second.getAudioChannelAllocation();
+ audio_channel_allocation = tmp;
+ }
+
if (codec_type == CodecType::LC3) {
return ComposeBroadcastCapability(
- codec_type,
- GetAudioLocation(
- strategy_configuration_iter->second.getAudioLocation()),
+ codec_type, audio_location, audio_channel_allocation,
strategy_configuration_iter->second.getChannelCount(), bcastLc3Cap);
}
return {.codecType = CodecType::UNKNOWN};
@@ -448,16 +499,21 @@
template <class T>
BroadcastCapability BluetoothLeAudioCodecsProvider::ComposeBroadcastCapability(
const CodecType& codec_type, const AudioLocation& audio_location,
+ const std::optional<CodecSpecificConfigurationLtv::AudioChannelAllocation>&
+ audio_channel_allocation,
const uint8_t& channel_count, const std::vector<T>& capability) {
return {.codecType = codec_type,
.supportedChannel = audio_location,
.channelCountPerStream = channel_count,
- .leAudioCodecCapabilities = std::optional(capability)};
+ .leAudioCodecCapabilities = std::optional(capability),
+ .audioLocation = audio_channel_allocation};
}
template <class T>
UnicastCapability BluetoothLeAudioCodecsProvider::ComposeUnicastCapability(
const CodecType& codec_type, const AudioLocation& audio_location,
+ const std::optional<CodecSpecificConfigurationLtv::AudioChannelAllocation>&
+ audio_channel_allocation,
const uint8_t& device_cnt, const uint8_t& channel_count,
const T& capability) {
return {
@@ -467,6 +523,7 @@
.channelCountPerDevice = channel_count,
.leAudioCodecCapabilities =
UnicastCapability::LeAudioCodecCapabilities(capability),
+ .audioLocation = audio_channel_allocation,
};
}
@@ -519,38 +576,87 @@
codec_configuration.hasOctetsPerCodecFrame();
}
+bool IsValidStereoAudioLocation(
+ const setting::StrategyConfiguration& strategy_configuration) {
+ if ((strategy_configuration.getConnectedDevice() == 2 &&
+ strategy_configuration.getChannelCount() == 1) ||
+ (strategy_configuration.getConnectedDevice() == 1 &&
+ strategy_configuration.getChannelCount() == 2)) {
+ // Stereo
+ // 1. two connected device, one for L one for R
+ // 2. one connected device for both L and R
+ return true;
+ } else if (strategy_configuration.getConnectedDevice() == 0 &&
+ strategy_configuration.getChannelCount() == 2) {
+ // Broadcast
+ return true;
+ }
+ return false;
+}
+
+bool IsValidMonoAudioLocation(
+ const setting::StrategyConfiguration& strategy_configuration) {
+ if (strategy_configuration.getConnectedDevice() == 1 &&
+ strategy_configuration.getChannelCount() == 1) {
+ return true;
+ }
+ return false;
+}
+
+bool IsValidAudioLocation(
+ const setting::StrategyConfiguration& strategy_configuration) {
+ if (strategy_configuration.getAudioLocation() ==
+ setting::AudioLocation::STEREO)
+ return IsValidStereoAudioLocation(strategy_configuration);
+ else if (strategy_configuration.getAudioLocation() ==
+ setting::AudioLocation::MONO)
+ return IsValidMonoAudioLocation(strategy_configuration);
+ return false;
+}
+
+bool IsValidAudioChannelAllocation(
+ const setting::StrategyConfiguration& strategy_configuration) {
+ // First, ensure that there's only 2 bitmask enabled
+ int audio_channel_allocation =
+ strategy_configuration.getAudioChannelAllocation();
+ int count = 0;
+ for (int bit = 0; bit < 32; ++bit)
+ if (audio_channel_allocation & (1 << bit)) ++count;
+ if (count > 2) {
+ LOG(WARNING) << "Cannot parse more than 2 audio location, input is "
+ << audio_channel_allocation;
+ return false;
+ }
+
+ if (count == 2)
+ return IsValidStereoAudioLocation(strategy_configuration);
+ else
+ return IsValidMonoAudioLocation(strategy_configuration);
+}
+
bool BluetoothLeAudioCodecsProvider::IsValidStrategyConfiguration(
const setting::StrategyConfiguration& strategy_configuration) {
if (!strategy_configuration.hasName() ||
- !strategy_configuration.hasAudioLocation() ||
!strategy_configuration.hasConnectedDevice() ||
!strategy_configuration.hasChannelCount()) {
return false;
}
- if (strategy_configuration.getAudioLocation() ==
- setting::AudioLocation::STEREO) {
- if ((strategy_configuration.getConnectedDevice() == 2 &&
- strategy_configuration.getChannelCount() == 1) ||
- (strategy_configuration.getConnectedDevice() == 1 &&
- strategy_configuration.getChannelCount() == 2)) {
- // Stereo
- // 1. two connected device, one for L one for R
- // 2. one connected device for both L and R
- return true;
- } else if (strategy_configuration.getConnectedDevice() == 0 &&
- strategy_configuration.getChannelCount() == 2) {
- // Broadcast
- return true;
- }
- } else if (strategy_configuration.getAudioLocation() ==
- setting::AudioLocation::MONO) {
- if (strategy_configuration.getConnectedDevice() == 1 &&
- strategy_configuration.getChannelCount() == 1) {
- // Mono
- return true;
- }
- }
- return false;
+
+ // Both audio location field cannot be empty
+ if (!strategy_configuration.hasAudioLocation() &&
+ !strategy_configuration.hasAudioChannelAllocation())
+ return false;
+
+ // Any audio location field that presents must be valid
+ if (strategy_configuration.hasAudioLocation() &&
+ !IsValidAudioLocation(strategy_configuration))
+ return false;
+
+ if (strategy_configuration.hasAudioChannelAllocation() &&
+ !IsValidAudioChannelAllocation(strategy_configuration))
+ return false;
+
+ return true;
}
} // namespace audio
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothLeAudioCodecsProvider.h b/bluetooth/audio/utils/aidl_session/BluetoothLeAudioCodecsProvider.h
index 5bf67e2..23b2bb6 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothLeAudioCodecsProvider.h
+++ b/bluetooth/audio/utils/aidl_session/BluetoothLeAudioCodecsProvider.h
@@ -23,6 +23,7 @@
#include <vector>
#include "aidl/android/hardware/bluetooth/audio/CodecInfo.h"
+#include "aidl/android/hardware/bluetooth/audio/CodecSpecificConfigurationLtv.h"
#include "aidl/android/hardware/bluetooth/audio/SessionType.h"
#include "aidl_android_hardware_bluetooth_audio_setting.h"
@@ -84,12 +85,18 @@
template <class T>
static inline UnicastCapability ComposeUnicastCapability(
const CodecType& codec_type, const AudioLocation& audio_location,
+ const std::optional<
+ CodecSpecificConfigurationLtv::AudioChannelAllocation>&
+ audio_channel_allocation,
const uint8_t& device_cnt, const uint8_t& channel_count,
const T& capability);
template <class T>
static inline BroadcastCapability ComposeBroadcastCapability(
const CodecType& codec_type, const AudioLocation& audio_location,
+ const std::optional<
+ CodecSpecificConfigurationLtv::AudioChannelAllocation>&
+ audio_channel_allocation,
const uint8_t& channel_count, const std::vector<T>& capability);
static inline Lc3Capabilities ComposeLc3Capability(
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothLeAudioCodecsProviderTest.cpp b/bluetooth/audio/utils/aidl_session/BluetoothLeAudioCodecsProviderTest.cpp
index dba2749..c47f7d5 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothLeAudioCodecsProviderTest.cpp
+++ b/bluetooth/audio/utils/aidl_session/BluetoothLeAudioCodecsProviderTest.cpp
@@ -64,19 +64,101 @@
static const StrategyConfiguration kValidStrategyStereoOneCis(
std::make_optional("STEREO_ONE_CIS_PER_DEVICE"),
std::make_optional(AudioLocation::STEREO), std::make_optional(2),
- std::make_optional(1));
+ std::make_optional(1), std::nullopt);
static const StrategyConfiguration kValidStrategyStereoTwoCis(
std::make_optional("STEREO_TWO_CISES_PER_DEVICE"),
std::make_optional(AudioLocation::STEREO), std::make_optional(1),
- std::make_optional(2));
+ std::make_optional(2), std::nullopt);
static const StrategyConfiguration kValidStrategyMonoOneCis(
std::make_optional("MONO_ONE_CIS_PER_DEVICE"),
std::make_optional(AudioLocation::MONO), std::make_optional(1),
- std::make_optional(1));
+ std::make_optional(1), std::nullopt);
static const StrategyConfiguration kValidStrategyBroadcastStereo(
std::make_optional("BROADCAST_STEREO"),
std::make_optional(AudioLocation::STEREO), std::make_optional(0),
- std::make_optional(2));
+ std::make_optional(2), std::nullopt);
+
+static const StrategyConfiguration kValidStrategyStereoOneCisInt(
+ std::make_optional("STEREO_ONE_CIS_PER_DEVICE"), std::nullopt,
+ std::make_optional(2), std::make_optional(1), std::make_optional(3));
+static const StrategyConfiguration kValidStrategyStereoTwoCisInt(
+ std::make_optional("STEREO_TWO_CISES_PER_DEVICE"), std::nullopt,
+ std::make_optional(1), std::make_optional(2), std::make_optional(3));
+static const StrategyConfiguration kValidStrategyMonoOneCisInt(
+ std::make_optional("MONO_ONE_CIS_PER_DEVICE"), std::nullopt,
+ std::make_optional(1), std::make_optional(1), std::make_optional(4));
+static const StrategyConfiguration kValidStrategyBroadcastStereoInt(
+ std::make_optional("BROADCAST_STEREO"), std::nullopt, std::make_optional(0),
+ std::make_optional(2), std::make_optional(3));
+
+static const StrategyConfiguration kValidStrategyStereoOneCisBoth(
+ std::make_optional("STEREO_ONE_CIS_PER_DEVICE"),
+ std::make_optional(AudioLocation::STEREO), std::make_optional(2),
+ std::make_optional(1), std::make_optional(3));
+static const StrategyConfiguration kValidStrategyStereoTwoCisBoth(
+ std::make_optional("STEREO_TWO_CISES_PER_DEVICE"),
+ std::make_optional(AudioLocation::STEREO), std::make_optional(1),
+ std::make_optional(2), std::make_optional(3));
+static const StrategyConfiguration kValidStrategyMonoOneCisBoth(
+ std::make_optional("MONO_ONE_CIS_PER_DEVICE"),
+ std::make_optional(AudioLocation::MONO), std::make_optional(1),
+ std::make_optional(1), std::make_optional(4));
+static const StrategyConfiguration kValidStrategyBroadcastStereoBoth(
+ std::make_optional("BROADCAST_STEREO"),
+ std::make_optional(AudioLocation::STEREO), std::make_optional(0),
+ std::make_optional(2), std::make_optional(3));
+
+// List of all invalid strategy configuration
+const auto kInvalidStrategyStereoTwoCisTwoDevice = StrategyConfigurationList(
+ std::vector<StrategyConfiguration>{StrategyConfiguration(
+ std::make_optional("STEREO_ONE_CIS_PER_DEVICE"),
+ std::make_optional(AudioLocation::STEREO), std::make_optional(2),
+ std::make_optional(2), std::nullopt)});
+const auto kInvalidStrategyMonoTwoCisTwoDevice = StrategyConfigurationList(
+ std::vector<StrategyConfiguration>{StrategyConfiguration(
+ std::make_optional("MONO_ONE_CIS_PER_DEVICE"),
+ std::make_optional(AudioLocation::STEREO), std::make_optional(2),
+ std::make_optional(2), std::nullopt)});
+const auto kInvalidStrategyNoName = StrategyConfigurationList(
+ std::vector<StrategyConfiguration>{StrategyConfiguration(
+ std::nullopt, std::make_optional(AudioLocation::STEREO),
+ std::make_optional(2), std::make_optional(1), std::nullopt)});
+const auto kInvalidStrategyNoLocation = StrategyConfigurationList(
+ std::vector<StrategyConfiguration>{StrategyConfiguration(
+ std::make_optional("STEREO_ONE_CIS_PER_DEVICE"), std::nullopt,
+ std::make_optional(2), std::make_optional(1), std::nullopt)});
+const auto kInvalidStrategyNoDevice = StrategyConfigurationList(
+ std::vector<StrategyConfiguration>{StrategyConfiguration(
+ std::make_optional("STEREO_ONE_CIS_PER_DEVICE"),
+ std::make_optional(AudioLocation::STEREO), std::nullopt,
+ std::make_optional(1), std::nullopt)});
+const auto kInvalidStrategyNoChannel = StrategyConfigurationList(
+ std::vector<StrategyConfiguration>{StrategyConfiguration(
+ std::make_optional("STEREO_ONE_CIS_PER_DEVICE"),
+ std::make_optional(AudioLocation::STEREO), std::make_optional(2),
+ std::nullopt, std::nullopt)});
+const auto kInvalidStrategyIntMoreBitmask = StrategyConfigurationList(
+ std::vector<StrategyConfiguration>{StrategyConfiguration(
+ std::make_optional("STEREO_ONE_CIS_PER_DEVICE"),
+ std::make_optional(AudioLocation::STEREO), std::make_optional(2),
+ std::make_optional(1), std::make_optional(7))});
+const auto kInvalidStrategyIntStereoTwoCisTwoDevice = StrategyConfigurationList(
+ std::vector<StrategyConfiguration>{StrategyConfiguration(
+ std::make_optional("STEREO_ONE_CIS_PER_DEVICE"), std::nullopt,
+ std::make_optional(2), std::make_optional(2), std::make_optional(3))});
+const auto kInvalidStrategyIntMonoTwoCisTwoDevice = StrategyConfigurationList(
+ std::vector<StrategyConfiguration>{StrategyConfiguration(
+ std::make_optional("MONO_ONE_CIS_PER_DEVICE"), std::nullopt,
+ std::make_optional(2), std::make_optional(2), std::make_optional(4))});
+const auto kInvalidStrategyIntBroadcast = StrategyConfigurationList(
+ std::vector<StrategyConfiguration>{StrategyConfiguration(
+ std::make_optional("MONO_ONE_CIS_PER_DEVICE"), std::nullopt,
+ std::make_optional(0), std::make_optional(1), std::make_optional(3))});
+const auto kInvalidStrategyBothStereoMonoInt = StrategyConfigurationList(
+ std::vector<StrategyConfiguration>{StrategyConfiguration(
+ std::make_optional("STEREO_ONE_CIS_PER_DEVICE"),
+ std::make_optional(AudioLocation::STEREO), std::make_optional(2),
+ std::make_optional(1), std::make_optional(4))});
// Define valid test list built from above valid components
// Scenario, Configuration, CodecConfiguration, StrategyConfiguration
@@ -88,11 +170,16 @@
static const std::vector<CodecConfigurationList> kValidCodecConfigurationList =
{CodecConfigurationList(
std::vector<CodecConfiguration>{kValidCodecLC3_16k_1})};
+
static const std::vector<StrategyConfigurationList>
kValidStrategyConfigurationList = {
StrategyConfigurationList(std::vector<StrategyConfiguration>{
kValidStrategyStereoOneCis, kValidStrategyStereoTwoCis,
- kValidStrategyMonoOneCis, kValidStrategyBroadcastStereo})};
+ kValidStrategyMonoOneCis, kValidStrategyBroadcastStereo,
+ kValidStrategyStereoOneCisInt, kValidStrategyStereoTwoCisInt,
+ kValidStrategyMonoOneCisInt, kValidStrategyBroadcastStereoInt,
+ kValidStrategyStereoOneCisBoth, kValidStrategyStereoTwoCisBoth,
+ kValidStrategyMonoOneCisBoth, kValidStrategyBroadcastStereoBoth})};
class BluetoothLeAudioCodecsProviderTest
: public ::testing::TestWithParam<OffloadSetting> {
@@ -270,49 +357,19 @@
static std::vector<StrategyConfigurationList>
CreateInvalidStrategyConfigurations() {
std::vector<StrategyConfigurationList>
- invalid_strategy_configuration_test_cases;
- invalid_strategy_configuration_test_cases.push_back(
- StrategyConfigurationList(
- std::vector<StrategyConfiguration>{StrategyConfiguration(
- std::make_optional("STEREO_ONE_CIS_PER_DEVICE"),
- std::make_optional(AudioLocation::STEREO),
- std::make_optional(2), std::make_optional(2))}));
-
- invalid_strategy_configuration_test_cases.push_back(
- StrategyConfigurationList(
- std::vector<StrategyConfiguration>{StrategyConfiguration(
- std::make_optional("MONO_ONE_CIS_PER_DEVICE"),
- std::make_optional(AudioLocation::STEREO),
- std::make_optional(2), std::make_optional(2))}));
-
- invalid_strategy_configuration_test_cases.push_back(
- StrategyConfigurationList(
- std::vector<StrategyConfiguration>{StrategyConfiguration(
- std::nullopt, std::make_optional(AudioLocation::STEREO),
- std::make_optional(2), std::make_optional(1))}));
-
- invalid_strategy_configuration_test_cases.push_back(
- StrategyConfigurationList(
- std::vector<StrategyConfiguration>{StrategyConfiguration(
- std::make_optional("STEREO_ONE_CIS_PER_DEVICE"), std::nullopt,
- std::make_optional(2), std::make_optional(1))}));
-
- invalid_strategy_configuration_test_cases.push_back(
- StrategyConfigurationList(
- std::vector<StrategyConfiguration>{StrategyConfiguration(
- std::make_optional("STEREO_ONE_CIS_PER_DEVICE"),
- std::make_optional(AudioLocation::STEREO), std::nullopt,
- std::make_optional(1))}));
-
- invalid_strategy_configuration_test_cases.push_back(
- StrategyConfigurationList(
- std::vector<StrategyConfiguration>{StrategyConfiguration(
- std::make_optional("STEREO_ONE_CIS_PER_DEVICE"),
- std::make_optional(AudioLocation::STEREO),
- std::make_optional(2), std::nullopt)}));
-
- invalid_strategy_configuration_test_cases.push_back(
- StrategyConfigurationList(std::vector<StrategyConfiguration>{}));
+ invalid_strategy_configuration_test_cases = {
+ kInvalidStrategyStereoTwoCisTwoDevice,
+ kInvalidStrategyMonoTwoCisTwoDevice,
+ kInvalidStrategyNoName,
+ kInvalidStrategyNoLocation,
+ kInvalidStrategyNoDevice,
+ kInvalidStrategyNoChannel,
+ kInvalidStrategyIntMoreBitmask,
+ kInvalidStrategyIntStereoTwoCisTwoDevice,
+ kInvalidStrategyIntMonoTwoCisTwoDevice,
+ kInvalidStrategyIntBroadcast,
+ kInvalidStrategyBothStereoMonoInt,
+ StrategyConfigurationList(std::vector<StrategyConfiguration>{})};
return invalid_strategy_configuration_test_cases;
}
diff --git a/bluetooth/audio/utils/le_audio_codec_capabilities/le_audio_codec_capabilities.xml b/bluetooth/audio/utils/le_audio_codec_capabilities/le_audio_codec_capabilities.xml
index eaace78..b6ebbd9 100644
--- a/bluetooth/audio/utils/le_audio_codec_capabilities/le_audio_codec_capabilities.xml
+++ b/bluetooth/audio/utils/le_audio_codec_capabilities/le_audio_codec_capabilities.xml
@@ -69,9 +69,9 @@
<codecConfiguration name="APTX_ADAPTIVE_LEX_96k" codec="APTX_ADAPTIVE_LEX" samplingFrequency="96000" frameDurationUs="10000" octetsPerCodecFrame="816"/>
</codecConfigurationList>
<strategyConfigurationList>
- <strategyConfiguration name="STEREO_ONE_CIS_PER_DEVICE" audioLocation="STEREO" connectedDevice="2" channelCount="1"/>
- <strategyConfiguration name="STEREO_TWO_CISES_PER_DEVICE" audioLocation="STEREO" connectedDevice="1" channelCount="2"/>
- <strategyConfiguration name="MONO_ONE_CIS_PER_DEVICE" audioLocation="MONO" connectedDevice="1" channelCount="1"/>
- <strategyConfiguration name="BROADCAST_STEREO" audioLocation="STEREO" connectedDevice="0" channelCount="2"/>
+ <strategyConfiguration name="STEREO_ONE_CIS_PER_DEVICE" audioLocation="STEREO" connectedDevice="2" channelCount="1" audioChannelAllocation="3"/>
+ <strategyConfiguration name="STEREO_TWO_CISES_PER_DEVICE" audioLocation="STEREO" connectedDevice="1" channelCount="2" audioChannelAllocation="3"/>
+ <strategyConfiguration name="MONO_ONE_CIS_PER_DEVICE" audioLocation="MONO" connectedDevice="1" channelCount="1" audioChannelAllocation="4"/>
+ <strategyConfiguration name="BROADCAST_STEREO" audioLocation="STEREO" connectedDevice="0" channelCount="2" audioChannelAllocation="3"/>
</strategyConfigurationList>
</leAudioOffloadSetting>
diff --git a/bluetooth/audio/utils/le_audio_codec_capabilities/le_audio_codec_capabilities.xsd b/bluetooth/audio/utils/le_audio_codec_capabilities/le_audio_codec_capabilities.xsd
index 03c8ade..d9ccab5 100644
--- a/bluetooth/audio/utils/le_audio_codec_capabilities/le_audio_codec_capabilities.xsd
+++ b/bluetooth/audio/utils/le_audio_codec_capabilities/le_audio_codec_capabilities.xsd
@@ -56,9 +56,12 @@
<xs:element name="strategyConfiguration">
<xs:complexType>
<xs:attribute name="name" type="xs:string"/>
+ <!-- Deprecated definition of Audio Location, please use audioLocationInt -->
<xs:attribute name="audioLocation" type="audioLocation"/>
<xs:attribute name="connectedDevice" type="xs:unsignedByte"/>
<xs:attribute name="channelCount" type="xs:unsignedByte"/>
+ <!-- Integer Audio Location to populate to audioLocation if present -->
+ <xs:attribute name="audioChannelAllocation" type="xs:int"/>
</xs:complexType>
</xs:element>
<xs:simpleType name="audioLocation">
diff --git a/bluetooth/audio/utils/le_audio_codec_capabilities/schema/current.txt b/bluetooth/audio/utils/le_audio_codec_capabilities/schema/current.txt
index a882174..b6c2f03 100644
--- a/bluetooth/audio/utils/le_audio_codec_capabilities/schema/current.txt
+++ b/bluetooth/audio/utils/le_audio_codec_capabilities/schema/current.txt
@@ -81,10 +81,12 @@
public class StrategyConfiguration {
ctor public StrategyConfiguration();
+ method public int getAudioChannelAllocation();
method public aidl.android.hardware.bluetooth.audio.setting.AudioLocation getAudioLocation();
method public short getChannelCount();
method public short getConnectedDevice();
method public String getName();
+ method public void setAudioChannelAllocation(int);
method public void setAudioLocation(aidl.android.hardware.bluetooth.audio.setting.AudioLocation);
method public void setChannelCount(short);
method public void setConnectedDevice(short);
diff --git a/broadcastradio/aidl/default/fuzzer.cpp b/broadcastradio/aidl/default/fuzzer.cpp
index d535432..2492d47 100644
--- a/broadcastradio/aidl/default/fuzzer.cpp
+++ b/broadcastradio/aidl/default/fuzzer.cpp
@@ -24,6 +24,8 @@
using ::android::fuzzService;
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+ // TODO(b/183141167): need to rewrite 'dump' to avoid SIGPIPE.
+ signal(SIGPIPE, SIG_IGN);
const VirtualRadio& amFmRadioMock = VirtualRadio::getAmFmRadio();
std::shared_ptr<BroadcastRadio> amFmRadio =
::ndk::SharedRefBase::make<BroadcastRadio>(amFmRadioMock);
diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSection.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSection.aidl
index 5a35915..49243dd 100644
--- a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSection.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSection.aidl
@@ -73,5 +73,6 @@
ANDROID_EXTENSION,
ANDROID_JPEGR,
ANDROID_SHARED_SESSION,
+ ANDROID_DESKTOP_EFFECTS,
VENDOR_SECTION = 0x8000,
}
diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl
index 4cdca62..588179f 100644
--- a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl
@@ -73,5 +73,6 @@
ANDROID_EXTENSION_START = (android.hardware.camera.metadata.CameraMetadataSection.ANDROID_EXTENSION << 16) /* 2097152 */,
ANDROID_JPEGR_START = (android.hardware.camera.metadata.CameraMetadataSection.ANDROID_JPEGR << 16) /* 2162688 */,
ANDROID_SHARED_SESSION_START = (android.hardware.camera.metadata.CameraMetadataSection.ANDROID_SHARED_SESSION << 16) /* 2228224 */,
+ ANDROID_DESKTOP_EFFECTS_START = (android.hardware.camera.metadata.CameraMetadataSection.ANDROID_DESKTOP_EFFECTS << 16) /* 2293760 */,
VENDOR_SECTION_START = (android.hardware.camera.metadata.CameraMetadataSection.VENDOR_SECTION << 16) /* -2147483648 */,
}
diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataTag.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataTag.aidl
index 2615270..c3cb3f7 100644
--- a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataTag.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataTag.aidl
@@ -366,4 +366,10 @@
ANDROID_JPEGR_AVAILABLE_JPEG_R_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION,
ANDROID_JPEGR_AVAILABLE_JPEG_R_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION,
ANDROID_JPEGR_AVAILABLE_JPEG_R_STALL_DURATIONS_MAXIMUM_RESOLUTION,
+ ANDROID_DESKTOP_EFFECTS_CAPABILITIES = android.hardware.camera.metadata.CameraMetadataSectionStart.ANDROID_DESKTOP_EFFECTS_START /* 2293760 */,
+ ANDROID_DESKTOP_EFFECTS_BACKGROUND_BLUR_MODES,
+ ANDROID_DESKTOP_EFFECTS_BACKGROUND_BLUR_MODE,
+ ANDROID_DESKTOP_EFFECTS_FACE_RETOUCH_MODE,
+ ANDROID_DESKTOP_EFFECTS_FACE_RETOUCH_STRENGTH,
+ ANDROID_DESKTOP_EFFECTS_PORTRAIT_RELIGHT_MODE,
}
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ValueRange.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DesktopEffectsBackgroundBlurMode.aidl
similarity index 79%
copy from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ValueRange.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DesktopEffectsBackgroundBlurMode.aidl
index 077652b..36da888 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ValueRange.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DesktopEffectsBackgroundBlurMode.aidl
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,10 +35,10 @@
// 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.automotive.vehicle;
-@JavaDerive(equals=true, toString=true) @RustDerive(Clone=true) @VintfStability
-parcelable ValueRange {
- @nullable android.hardware.automotive.vehicle.RawPropValues minValue;
- @nullable android.hardware.automotive.vehicle.RawPropValues maxValue;
- @nullable List<android.hardware.automotive.vehicle.RawPropValues> supportedValues;
+package android.hardware.camera.metadata;
+@Backing(type="int") @VintfStability
+enum DesktopEffectsBackgroundBlurMode {
+ ANDROID_DESKTOP_EFFECTS_BACKGROUND_BLUR_MODE_OFF,
+ ANDROID_DESKTOP_EFFECTS_BACKGROUND_BLUR_MODE_LIGHT,
+ ANDROID_DESKTOP_EFFECTS_BACKGROUND_BLUR_MODE_FULL,
}
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ValueRange.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DesktopEffectsCapabilities.aidl
similarity index 79%
copy from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ValueRange.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DesktopEffectsCapabilities.aidl
index 077652b..d16ef99 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ValueRange.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DesktopEffectsCapabilities.aidl
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,10 +35,10 @@
// 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.automotive.vehicle;
-@JavaDerive(equals=true, toString=true) @RustDerive(Clone=true) @VintfStability
-parcelable ValueRange {
- @nullable android.hardware.automotive.vehicle.RawPropValues minValue;
- @nullable android.hardware.automotive.vehicle.RawPropValues maxValue;
- @nullable List<android.hardware.automotive.vehicle.RawPropValues> supportedValues;
+package android.hardware.camera.metadata;
+@Backing(type="int") @VintfStability
+enum DesktopEffectsCapabilities {
+ ANDROID_DESKTOP_EFFECTS_CAPABILITIES_BACKGROUND_BLUR,
+ ANDROID_DESKTOP_EFFECTS_CAPABILITIES_FACE_RETOUCH,
+ ANDROID_DESKTOP_EFFECTS_CAPABILITIES_PORTRAIT_RELIGHT,
}
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ValueRange.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DesktopEffectsFaceRetouchMode.aidl
similarity index 81%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ValueRange.aidl
rename to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DesktopEffectsFaceRetouchMode.aidl
index 077652b..8004b91 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ValueRange.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DesktopEffectsFaceRetouchMode.aidl
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,10 +35,9 @@
// 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.automotive.vehicle;
-@JavaDerive(equals=true, toString=true) @RustDerive(Clone=true) @VintfStability
-parcelable ValueRange {
- @nullable android.hardware.automotive.vehicle.RawPropValues minValue;
- @nullable android.hardware.automotive.vehicle.RawPropValues maxValue;
- @nullable List<android.hardware.automotive.vehicle.RawPropValues> supportedValues;
+package android.hardware.camera.metadata;
+@Backing(type="int") @VintfStability
+enum DesktopEffectsFaceRetouchMode {
+ ANDROID_DESKTOP_EFFECTS_FACE_RETOUCH_MODE_OFF,
+ ANDROID_DESKTOP_EFFECTS_FACE_RETOUCH_MODE_ON,
}
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ValueRange.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DesktopEffectsPortraitRelightMode.aidl
similarity index 81%
copy from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ValueRange.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DesktopEffectsPortraitRelightMode.aidl
index 077652b..abd06a7 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ValueRange.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DesktopEffectsPortraitRelightMode.aidl
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,10 +35,9 @@
// 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.automotive.vehicle;
-@JavaDerive(equals=true, toString=true) @RustDerive(Clone=true) @VintfStability
-parcelable ValueRange {
- @nullable android.hardware.automotive.vehicle.RawPropValues minValue;
- @nullable android.hardware.automotive.vehicle.RawPropValues maxValue;
- @nullable List<android.hardware.automotive.vehicle.RawPropValues> supportedValues;
+package android.hardware.camera.metadata;
+@Backing(type="int") @VintfStability
+enum DesktopEffectsPortraitRelightMode {
+ ANDROID_DESKTOP_EFFECTS_PORTRAIT_RELIGHT_MODE_OFF,
+ ANDROID_DESKTOP_EFFECTS_PORTRAIT_RELIGHT_MODE_ON,
}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSection.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSection.aidl
index 2268dfd..b7edaf2 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSection.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSection.aidl
@@ -64,5 +64,6 @@
ANDROID_EXTENSION,
ANDROID_JPEGR,
ANDROID_SHARED_SESSION,
+ ANDROID_DESKTOP_EFFECTS,
VENDOR_SECTION = 0x8000,
}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl
index 3ec54d4..b36a433 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl
@@ -66,5 +66,6 @@
ANDROID_EXTENSION_START = CameraMetadataSection.ANDROID_EXTENSION << 16,
ANDROID_JPEGR_START = CameraMetadataSection.ANDROID_JPEGR << 16,
ANDROID_SHARED_SESSION_START = CameraMetadataSection.ANDROID_SHARED_SESSION << 16,
+ ANDROID_DESKTOP_EFFECTS_START = CameraMetadataSection.ANDROID_DESKTOP_EFFECTS << 16,
VENDOR_SECTION_START = CameraMetadataSection.VENDOR_SECTION << 16,
}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl
index 66ca912..8b2ac72 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl
@@ -2536,4 +2536,50 @@
* @see ANDROID_SENSOR_PIXEL_MODE
*/
ANDROID_JPEGR_AVAILABLE_JPEG_R_STALL_DURATIONS_MAXIMUM_RESOLUTION,
+ /**
+ * android.desktopEffects.capabilities [static, enum[], system]
+ *
+ * <p>List of special effects supported by the camera device.</p>
+ */
+ ANDROID_DESKTOP_EFFECTS_CAPABILITIES = CameraMetadataSectionStart.ANDROID_DESKTOP_EFFECTS_START,
+ /**
+ * android.desktopEffects.backgroundBlurModes [static, byte[], system]
+ *
+ * <p>List of background blur modes supported by the camera device. The key will only exist
+ * if BACKGROUND_BLUR is listed by ANDROID_DESKTOP_EFFECTS_CAPABILITIES.</p>
+ *
+ * @see ANDROID_DESKTOP_EFFECTS_CAPABILITIES
+ */
+ ANDROID_DESKTOP_EFFECTS_BACKGROUND_BLUR_MODES,
+ /**
+ * android.desktopEffects.backgroundBlurMode [controls, enum, system]
+ *
+ * <p>Control how the background should be blurred. Supported modes are listed in
+ * ANDROID_DESKTOP_EFFECTS_BACKGROUND_BLUR_MODES by the camera device.</p>
+ *
+ * @see ANDROID_DESKTOP_EFFECTS_BACKGROUND_BLUR_MODES
+ */
+ ANDROID_DESKTOP_EFFECTS_BACKGROUND_BLUR_MODE,
+ /**
+ * android.desktopEffects.faceRetouchMode [controls, enum, system]
+ *
+ * <p>Whether to enable face retouch effect.</p>
+ */
+ ANDROID_DESKTOP_EFFECTS_FACE_RETOUCH_MODE,
+ /**
+ * android.desktopEffects.faceRetouchStrength [controls, byte, system]
+ *
+ * <p>Control the strength of face retouch applied to the frames. If
+ * ANDROID_DESKTOP_EFFECTS_FACE_RETOUCH_MODE in ON without a faceRetouchStrength,
+ * a default will be set by the camera device.</p>
+ *
+ * @see ANDROID_DESKTOP_EFFECTS_FACE_RETOUCH_MODE
+ */
+ ANDROID_DESKTOP_EFFECTS_FACE_RETOUCH_STRENGTH,
+ /**
+ * android.desktopEffects.portraitRelightMode [controls, enum, system]
+ *
+ * <p>Whether to enable portrait relighting effect.</p>
+ */
+ ANDROID_DESKTOP_EFFECTS_PORTRAIT_RELIGHT_MODE,
}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/DesktopEffectsBackgroundBlurMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/DesktopEffectsBackgroundBlurMode.aidl
new file mode 100644
index 0000000..e8b2180
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/DesktopEffectsBackgroundBlurMode.aidl
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.desktopEffects.backgroundBlurMode enumeration values
+ * @see ANDROID_DESKTOP_EFFECTS_BACKGROUND_BLUR_MODE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
+ */
+@VintfStability
+@Backing(type="int")
+enum DesktopEffectsBackgroundBlurMode {
+ ANDROID_DESKTOP_EFFECTS_BACKGROUND_BLUR_MODE_OFF,
+ ANDROID_DESKTOP_EFFECTS_BACKGROUND_BLUR_MODE_LIGHT,
+ ANDROID_DESKTOP_EFFECTS_BACKGROUND_BLUR_MODE_FULL,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/DesktopEffectsCapabilities.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/DesktopEffectsCapabilities.aidl
new file mode 100644
index 0000000..45cb78e
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/DesktopEffectsCapabilities.aidl
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.desktopEffects.capabilities enumeration values
+ * @see ANDROID_DESKTOP_EFFECTS_CAPABILITIES
+ * See system/media/camera/docs/metadata_definitions.xml for details.
+ */
+@VintfStability
+@Backing(type="int")
+enum DesktopEffectsCapabilities {
+ ANDROID_DESKTOP_EFFECTS_CAPABILITIES_BACKGROUND_BLUR,
+ ANDROID_DESKTOP_EFFECTS_CAPABILITIES_FACE_RETOUCH,
+ ANDROID_DESKTOP_EFFECTS_CAPABILITIES_PORTRAIT_RELIGHT,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/DesktopEffectsFaceRetouchMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/DesktopEffectsFaceRetouchMode.aidl
new file mode 100644
index 0000000..d8c8101
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/DesktopEffectsFaceRetouchMode.aidl
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.desktopEffects.faceRetouchMode enumeration values
+ * @see ANDROID_DESKTOP_EFFECTS_FACE_RETOUCH_MODE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
+ */
+@VintfStability
+@Backing(type="int")
+enum DesktopEffectsFaceRetouchMode {
+ ANDROID_DESKTOP_EFFECTS_FACE_RETOUCH_MODE_OFF,
+ ANDROID_DESKTOP_EFFECTS_FACE_RETOUCH_MODE_ON,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/DesktopEffectsPortraitRelightMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/DesktopEffectsPortraitRelightMode.aidl
new file mode 100644
index 0000000..4a1d438
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/DesktopEffectsPortraitRelightMode.aidl
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.desktopEffects.portraitRelightMode enumeration values
+ * @see ANDROID_DESKTOP_EFFECTS_PORTRAIT_RELIGHT_MODE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
+ */
+@VintfStability
+@Backing(type="int")
+enum DesktopEffectsPortraitRelightMode {
+ ANDROID_DESKTOP_EFFECTS_PORTRAIT_RELIGHT_MODE_OFF,
+ ANDROID_DESKTOP_EFFECTS_PORTRAIT_RELIGHT_MODE_ON,
+}
diff --git a/compatibility_matrices/compatibility_matrix.202504.xml b/compatibility_matrices/compatibility_matrix.202504.xml
index 3b16bc9..8d5a50a 100644
--- a/compatibility_matrices/compatibility_matrix.202504.xml
+++ b/compatibility_matrices/compatibility_matrix.202504.xml
@@ -312,7 +312,7 @@
</hal>
<hal format="aidl">
<name>android.hardware.security.secretkeeper</name>
- <version>1</version>
+ <version>1-2</version>
<interface>
<name>ISecretkeeper</name>
<instance>default</instance>
@@ -543,7 +543,7 @@
</hal>
<hal format="aidl">
<name>android.hardware.sensors</name>
- <version>2</version>
+ <version>2-3</version>
<interface>
<name>ISensors</name>
<instance>default</instance>
@@ -615,7 +615,7 @@
</hal>
<hal format="aidl">
<name>android.hardware.tv.input</name>
- <version>1-2</version>
+ <version>1-3</version>
<interface>
<name>ITvInput</name>
<instance>default</instance>
@@ -653,6 +653,15 @@
</interface>
</hal>
<hal format="aidl">
+ <name>android.hardware.virtualization.capabilities</name>
+ <version>1</version>
+ <interface>
+ <name>IVmCapabilitiesService</name>
+ <instance>default</instance>
+ <instance>noop</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
<name>android.hardware.weaver</name>
<version>2</version>
<interface>
diff --git a/compatibility_matrices/exclude/fcm_exclude.cpp b/compatibility_matrices/exclude/fcm_exclude.cpp
index 4995a72..57e039c 100644
--- a/compatibility_matrices/exclude/fcm_exclude.cpp
+++ b/compatibility_matrices/exclude/fcm_exclude.cpp
@@ -171,6 +171,7 @@
"android.hardware.audio.core.sounddose@3",
// This is only used by a trusty VM
"android.hardware.security.see.authmgr@1",
+ "android.hardware.security.see.hdcp@1",
// Deprecated HALs.
"android.hardware.audio.sounddose@3",
diff --git a/drm/Android.bp b/drm/Android.bp
new file mode 100644
index 0000000..35c1b03
--- /dev/null
+++ b/drm/Android.bp
@@ -0,0 +1,5 @@
+dirgroup {
+ name: "trusty_dirgroup_hardware_interfaces_drm",
+ dirs: ["."],
+ visibility: ["//trusty/vendor/google/aosp/scripts"],
+}
diff --git a/drm/aidl/Android.bp b/drm/aidl/Android.bp
index 827621c..7ee8c34 100644
--- a/drm/aidl/Android.bp
+++ b/drm/aidl/Android.bp
@@ -27,6 +27,9 @@
ndk: {
min_sdk_version: "34",
},
+ rust: {
+ enabled: true,
+ },
},
double_loadable: true,
versions_with_info: [
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/BeidouSatelliteEphemeris.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/BeidouSatelliteEphemeris.aidl
index 91735a0..ec517e6 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/BeidouSatelliteEphemeris.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/BeidouSatelliteEphemeris.aidl
@@ -27,7 +27,7 @@
android.hardware.gnss.gnss_assistance.BeidouSatelliteEphemeris.BeidouSatelliteEphemerisTime satelliteEphemerisTime;
@VintfStability
parcelable BeidouSatelliteClockModel {
- android.hardware.gnss.gnss_assistance.TimeOfClock timeOfClock;
+ long timeOfClockSeconds;
double af0;
double af1;
double af2;
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GalileoSatelliteEphemeris.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GalileoSatelliteEphemeris.aidl
index 17d48b1..1bac08e 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GalileoSatelliteEphemeris.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GalileoSatelliteEphemeris.aidl
@@ -42,7 +42,7 @@
android.hardware.gnss.gnss_assistance.SatelliteEphemerisTime satelliteEphemerisTime;
@VintfStability
parcelable GalileoSatelliteClockModel {
- android.hardware.gnss.gnss_assistance.TimeOfClock toc;
+ long timeOfClockSeconds;
double af0;
double af1;
double af2;
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GlonassAlmanac.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GlonassAlmanac.aidl
index a545166..55621ab 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GlonassAlmanac.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GlonassAlmanac.aidl
@@ -20,7 +20,7 @@
/* @hide */
@VintfStability
parcelable GlonassAlmanac {
- long issueDate;
+ long issueDateMs;
android.hardware.gnss.gnss_assistance.GlonassAlmanac.GlonassSatelliteAlmanac[] satelliteAlmanac;
@VintfStability
parcelable GlonassSatelliteAlmanac {
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GlonassSatelliteEphemeris.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GlonassSatelliteEphemeris.aidl
index fbab59c..bbcb3af 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GlonassSatelliteEphemeris.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GlonassSatelliteEphemeris.aidl
@@ -43,7 +43,7 @@
android.hardware.gnss.gnss_assistance.GlonassSatelliteEphemeris.GlonassSatelliteOrbitModel satelliteOrbitModel;
@VintfStability
parcelable GlonassSatelliteClockModel {
- android.hardware.gnss.gnss_assistance.TimeOfClock timeOfClock;
+ long timeOfClockSeconds;
double clockBias;
double freqBias;
int freqNumber;
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GpsSatelliteEphemeris.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GpsSatelliteEphemeris.aidl
index 1e80516..721edb4 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GpsSatelliteEphemeris.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GpsSatelliteEphemeris.aidl
@@ -48,7 +48,7 @@
}
@VintfStability
parcelable GpsSatelliteClockModel {
- android.hardware.gnss.gnss_assistance.TimeOfClock timeOfClock;
+ long timeOfClockSeconds;
double af0;
double af1;
double af2;
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/BeidouSatelliteEphemeris.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/BeidouSatelliteEphemeris.aidl
index 48398ef..bb1f7d9 100644
--- a/gnss/aidl/android/hardware/gnss/gnss_assistance/BeidouSatelliteEphemeris.aidl
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/BeidouSatelliteEphemeris.aidl
@@ -1,7 +1,6 @@
package android.hardware.gnss.gnss_assistance;
import android.hardware.gnss.gnss_assistance.KeplerianOrbitModel;
-import android.hardware.gnss.gnss_assistance.TimeOfClock;
/**
* Contains ephemeris parameters specific to Beidou satellites.
@@ -17,8 +16,13 @@
*/
@VintfStability
parcelable BeidouSatelliteClockModel {
- /** Time of the clock. */
- TimeOfClock timeOfClock;
+ /**
+ * Time of the clock in seconds since Beidou epoch.
+ *
+ * Represents the 'Epoch' field within the 'SV/EPOCH/SV CLK' record of GNSS
+ * navigation message file in RINEX 3.05 Table A14.
+ */
+ long timeOfClockSeconds;
/** SV clock bias in seconds. */
double af0;
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/GalileoSatelliteEphemeris.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/GalileoSatelliteEphemeris.aidl
index 1562934..e3160ef 100644
--- a/gnss/aidl/android/hardware/gnss/gnss_assistance/GalileoSatelliteEphemeris.aidl
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/GalileoSatelliteEphemeris.aidl
@@ -18,7 +18,6 @@
import android.hardware.gnss.gnss_assistance.KeplerianOrbitModel;
import android.hardware.gnss.gnss_assistance.SatelliteEphemerisTime;
-import android.hardware.gnss.gnss_assistance.TimeOfClock;
/**
* Contains ephemeris parameters specific to Galileo satellites.
@@ -44,8 +43,13 @@
GALILEO_INAV_CLOCK = 2
}
- /** Time of the clock. */
- TimeOfClock toc;
+ /**
+ * Time of the clock in seconds since Galileo epoch.
+ *
+ * Represents the 'Epoch' field within the 'SV/EPOCH/SV CLK' record of GNSS
+ * navigation message file in RINEX 3.05 Table A8 (Galileo).
+ */
+ long timeOfClockSeconds;
/** SV clock bias correction coefficient in seconds. */
double af0;
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/GlonassAlmanac.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/GlonassAlmanac.aidl
index 2662717..d4f149d 100644
--- a/gnss/aidl/android/hardware/gnss/gnss_assistance/GlonassAlmanac.aidl
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/GlonassAlmanac.aidl
@@ -48,8 +48,8 @@
double omega;
}
- /** Almanac reference UTC time in milliseconds. */
- long issueDate;
+ /** Almanac issue date in milliseconds (UTC). */
+ long issueDateMs;
/** Array of GlonassSatelliteAlmanac. */
GlonassSatelliteAlmanac[] satelliteAlmanac;
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/GlonassSatelliteEphemeris.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/GlonassSatelliteEphemeris.aidl
index 383aed1..bebde51 100644
--- a/gnss/aidl/android/hardware/gnss/gnss_assistance/GlonassSatelliteEphemeris.aidl
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/GlonassSatelliteEphemeris.aidl
@@ -17,7 +17,6 @@
package android.hardware.gnss.gnss_assistance;
import android.hardware.gnss.gnss_assistance.SatelliteEphemerisTime;
-import android.hardware.gnss.gnss_assistance.TimeOfClock;
/**
* Contains ephemeris parameters specific to Glonass satellites.
@@ -30,8 +29,13 @@
/** Contains the set of parameters needed for Glonass satellite clock correction. */
@VintfStability
parcelable GlonassSatelliteClockModel {
- /** Time of Clock. */
- TimeOfClock timeOfClock;
+ /**
+ * Time of the clock in seconds (UTC).
+ *
+ * Represents the 'Epoch' field within the 'SV/EPOCH/SV CLK' record of GNSS
+ * navigation message file in RINEX 3.05 Table A10.
+ */
+ long timeOfClockSeconds;
/** Clock bias in seconds (-TauN). */
double clockBias;
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/GnssAlmanac.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/GnssAlmanac.aidl
index e4f4bc8..08f3373 100644
--- a/gnss/aidl/android/hardware/gnss/gnss_assistance/GnssAlmanac.aidl
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/GnssAlmanac.aidl
@@ -29,7 +29,7 @@
@VintfStability
parcelable GnssAlmanac {
/**
- * Almanac issue date in milliseconds since the Unix epoch.
+ * Almanac issue date in milliseconds (UTC).
*
* This is unused for GPS/QZSS/Baidou.
*/
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/GpsSatelliteEphemeris.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/GpsSatelliteEphemeris.aidl
index b24c593..ab38030 100644
--- a/gnss/aidl/android/hardware/gnss/gnss_assistance/GpsSatelliteEphemeris.aidl
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/GpsSatelliteEphemeris.aidl
@@ -18,7 +18,6 @@
import android.hardware.gnss.gnss_assistance.KeplerianOrbitModel;
import android.hardware.gnss.gnss_assistance.SatelliteEphemerisTime;
-import android.hardware.gnss.gnss_assistance.TimeOfClock;
/**
* Contains ephemeris parameters specific to GPS satellites.
@@ -47,8 +46,13 @@
/** Contains the set of parameters needed for GPS satellite clock correction. */
@VintfStability
parcelable GpsSatelliteClockModel {
- /** Time of the clock. */
- TimeOfClock timeOfClock;
+ /**
+ * Time of the clock in seconds since GPS epoch.
+ *
+ * Represents the 'Epoch' field within the 'SV/EPOCH/SV CLK' record of GNSS
+ * navigation message file in RINEX 3.05 Table A6.
+ */
+ long timeOfClockSeconds;
/** SV clock bias in seconds. */
double af0;
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/QzssSatelliteEphemeris.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/QzssSatelliteEphemeris.aidl
index 7efa4d9..a5a22d0 100644
--- a/gnss/aidl/android/hardware/gnss/gnss_assistance/QzssSatelliteEphemeris.aidl
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/QzssSatelliteEphemeris.aidl
@@ -21,7 +21,6 @@
import android.hardware.gnss.gnss_assistance.GpsSatelliteEphemeris.GpsSatelliteHealth;
import android.hardware.gnss.gnss_assistance.KeplerianOrbitModel;
import android.hardware.gnss.gnss_assistance.SatelliteEphemerisTime;
-import android.hardware.gnss.gnss_assistance.TimeOfClock;
/**
* Contains ephemeris parameters specific to QZSS satellites.
diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Dataspace.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Dataspace.aidl
index 6ed5bb2..7264a21 100644
--- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Dataspace.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Dataspace.aidl
@@ -97,5 +97,6 @@
JPEG_APP_SEGMENTS = 0x1003,
HEIF = 0x1004,
JPEG_R = 0x1005,
+ HEIF_ULTRAHDR = 0x1006,
BT709_FULL_RANGE = (((1 << 16) | (3 << 22)) | (1 << 27)) /* 146866176 */,
}
diff --git a/graphics/common/aidl/android/hardware/graphics/common/Dataspace.aidl b/graphics/common/aidl/android/hardware/graphics/common/Dataspace.aidl
index 79737eb..8705aef 100644
--- a/graphics/common/aidl/android/hardware/graphics/common/Dataspace.aidl
+++ b/graphics/common/aidl/android/hardware/graphics/common/Dataspace.aidl
@@ -702,19 +702,32 @@
/**
* Ultra HDR
*
- * JPEG image with embedded 10-bit recovery map following the Ultra HDR specification.
+ * JPEG image with embedded HDR gain map following the Ultra HDR specification and
+ * ISO/CD 21496‐1
*
* This value must always remain aligned with the public ImageFormat Jpeg/R definition and is
* valid with formats:
* HAL_PIXEL_FORMAT_BLOB: JPEG image encoded by Ultra HDR encoder according to
* the <a href="https://developer.android.com/guide/topics/media/hdr-image-format">
* Ultra HDR Image format specification</a>.
- * The image contains a standard SDR JPEG and a recovery map. Ultra HDR decoders can use the
- * map to recover the 10-bit input image.
+ * The image contains a standard SDR JPEG and a gain map. Ultra HDR decoders can use the
+ * map to boost the brightness of the rendered image.
*/
JPEG_R = 0x1005,
/**
+ * ISO/IEC 23008-12:2024
+ *
+ * High Efficiency Image File Format (HEIF) with embedded HDR gain map
+ *
+ * This value is valid with formats:
+ * HAL_PIXEL_FORMAT_BLOB: A HEIC image encoded by HEIC or HEVC encoder
+ * according to ISO/IEC 23008-12:2024 that includes an HDR gain map and
+ * metadata according to ISO/CD 21496‐1.
+ */
+ HEIF_ULTRAHDR = 0x1006,
+
+ /**
* ITU-R Recommendation 709 (BT.709)
*
* High-definition television
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl
index adbc344..1e568b9 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl
@@ -89,6 +89,7 @@
oneway void notifyExpectedPresent(long display, in android.hardware.graphics.composer3.ClockMonotonicTimestamp expectedPresentTime, int frameIntervalNs);
int getMaxLayerPictureProfiles(long display);
oneway void startHdcpNegotiation(long display, in android.hardware.drm.HdcpLevels levels);
+ android.hardware.graphics.composer3.Luts[] getLuts(long display, in android.hardware.graphics.composer3.Buffer[] buffers);
const int EX_BAD_CONFIG = 1;
const int EX_BAD_DISPLAY = 2;
const int EX_BAD_LAYER = 3;
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
index b4d2e7f..7556962 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
@@ -22,6 +22,7 @@
import android.hardware.graphics.common.HdrConversionCapability;
import android.hardware.graphics.common.HdrConversionStrategy;
import android.hardware.graphics.common.Transform;
+import android.hardware.graphics.composer3.Buffer;
import android.hardware.graphics.composer3.ClientTargetProperty;
import android.hardware.graphics.composer3.ClockMonotonicTimestamp;
import android.hardware.graphics.composer3.ColorMode;
@@ -38,6 +39,7 @@
import android.hardware.graphics.composer3.FormatColorComponent;
import android.hardware.graphics.composer3.HdrCapabilities;
import android.hardware.graphics.composer3.IComposerCallback;
+import android.hardware.graphics.composer3.Luts;
import android.hardware.graphics.composer3.OverlayProperties;
import android.hardware.graphics.composer3.PerFrameMetadataKey;
import android.hardware.graphics.composer3.PowerMode;
@@ -956,4 +958,12 @@
*
*/
oneway void startHdcpNegotiation(long display, in HdcpLevels levels);
+
+ /*
+ * Returns the Luts based on the buffers.
+ *
+ * @param display is the display for which the luts are requested.
+ * @param buffers is the buffer where the luts can be computed from
+ */
+ Luts[] getLuts(long display, in Buffer[] buffers);
}
diff --git a/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/HealthInfo.aidl b/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/HealthInfo.aidl
index 548a793..d993040 100644
--- a/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/HealthInfo.aidl
+++ b/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/HealthInfo.aidl
@@ -60,6 +60,6 @@
android.hardware.health.BatteryChargingState chargingState;
android.hardware.health.BatteryChargingPolicy chargingPolicy;
@nullable android.hardware.health.BatteryHealthData batteryHealthData;
- @nullable android.hardware.health.HingeInfo[] foldInfos;
+ @nullable android.hardware.health.HingeInfo[] hingeInfos;
const int BATTERY_CHARGE_TIME_TO_FULL_NOW_SECONDS_UNSUPPORTED = (-1) /* -1 */;
}
diff --git a/health/aidl/android/hardware/health/HealthInfo.aidl b/health/aidl/android/hardware/health/HealthInfo.aidl
index 12a397a..1c953ee 100644
--- a/health/aidl/android/hardware/health/HealthInfo.aidl
+++ b/health/aidl/android/hardware/health/HealthInfo.aidl
@@ -151,5 +151,5 @@
/**
* Information about foldable hinge health. Will be an empty vector if no hinges present
*/
- @nullable HingeInfo[] foldInfos;
+ @nullable HingeInfo[] hingeInfos;
}
diff --git a/health/aidl/android/hardware/health/HingeInfo.aidl b/health/aidl/android/hardware/health/HingeInfo.aidl
index 19b46df..ad38821 100644
--- a/health/aidl/android/hardware/health/HingeInfo.aidl
+++ b/health/aidl/android/hardware/health/HingeInfo.aidl
@@ -27,7 +27,9 @@
/**
* returns count of times a given hinge has been folded.
*
- * opening fully counts as 1 fold and closing fully counts as another
+ * opening fully counts as 1 fold and closing fully counts as another.
+ * The hinge has to engage in its full range of motion to be considered
+ * a fold. Partial folds must not be counted.
*/
int numTimesFolded;
/**
diff --git a/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp b/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp
index c47ddca..a44cd5e 100644
--- a/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp
+++ b/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp
@@ -368,7 +368,8 @@
ASSERT_THAT(status, AnyOf(IsOk(), ExceptionIs(EX_UNSUPPORTED_OPERATION)));
if (!status.isOk()) return;
for (auto& hinge : value) {
- ASSERT_TRUE(hinge.expectedHingeLifespan > 0);
+ ASSERT_TRUE(hinge.expectedHingeLifespan >= 0);
+ ASSERT_TRUE(hinge.numTimesFolded >= 0);
}
}
diff --git a/power/OWNERS b/power/OWNERS
index 95778a4..13895bd 100644
--- a/power/OWNERS
+++ b/power/OWNERS
@@ -1,6 +1,3 @@
# Bug component: 826709
-
-# ADPF virtual team
-lpy@google.com
-wvw@google.com
file:platform/frameworks/base:/ADPF_OWNERS
+wvw@google.com
diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionHint.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionHint.aidl
index df31618..f6b32d0 100644
--- a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionHint.aidl
+++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionHint.aidl
@@ -42,4 +42,6 @@
GPU_LOAD_UP = 5,
GPU_LOAD_DOWN = 6,
GPU_LOAD_RESET = 7,
+ CPU_LOAD_SPIKE = 8,
+ GPU_LOAD_SPIKE = 9,
}
diff --git a/power/aidl/android/hardware/power/SessionHint.aidl b/power/aidl/android/hardware/power/SessionHint.aidl
index 1a8c505..1b8a3dd 100644
--- a/power/aidl/android/hardware/power/SessionHint.aidl
+++ b/power/aidl/android/hardware/power/SessionHint.aidl
@@ -72,4 +72,18 @@
* baseline to prepare for an arbitrary load, and must wake up if inactive.
*/
GPU_LOAD_RESET = 7,
+
+ /**
+ * This hint indicates an upcoming CPU workload that is abnormally large and
+ * not representative of the workload. This should be used for rare, one-time
+ * operations and should be ignored by any load tracking or session hysteresis.
+ */
+ CPU_LOAD_SPIKE = 8,
+
+ /**
+ * This hint indicates an upcoming GPU workload that is abnormally large and
+ * not representative of the workload. This should be used for rare, one-time
+ * operations and should be ignored by any load tracking or session hysteresis.
+ */
+ GPU_LOAD_SPIKE = 9,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl
index bba6bdd..ded4835 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl
@@ -53,4 +53,6 @@
oneway void setResponseFunctions(in android.hardware.radio.config.IRadioConfigResponse radioConfigResponse, in android.hardware.radio.config.IRadioConfigIndication radioConfigIndication);
oneway void setSimSlotsMapping(in int serial, in android.hardware.radio.config.SlotPortMapping[] slotMap);
oneway void getSimultaneousCallingSupport(in int serial);
+ oneway void getSimTypeInfo(in int serial);
+ oneway void setSimType(in int serial, in android.hardware.radio.config.SimType[] simTypes);
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigResponse.aidl
index 6ff7bd0..4e0e133 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigResponse.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigResponse.aidl
@@ -43,4 +43,6 @@
oneway void setPreferredDataModemResponse(in android.hardware.radio.RadioResponseInfo info);
oneway void setSimSlotsMappingResponse(in android.hardware.radio.RadioResponseInfo info);
oneway void getSimultaneousCallingSupportResponse(in android.hardware.radio.RadioResponseInfo info, in int[] enabledLogicalSlots);
+ oneway void getSimTypeInfoResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.config.SimTypeInfo[] simTypeInfo);
+ oneway void setSimTypeResponse(in android.hardware.radio.RadioResponseInfo info);
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimType.aidl
similarity index 89%
copy from gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
copy to radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimType.aidl
index ae709d4..b27c86f 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimType.aidl
@@ -31,14 +31,11 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.gnss.gnss_assistance;
+package android.hardware.radio.config;
/* @hide */
-@VintfStability
-parcelable TimeOfClock {
- int year;
- int month;
- int day;
- int hour;
- int minute;
- int seconds;
+@Backing(type="int") @JavaDerive(toString=true) @VintfStability
+enum SimType {
+ UNKNOWN = 0,
+ PHYSICAL = (1 << 0) /* 1 */,
+ ESIM = (1 << 1) /* 2 */,
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimTypeInfo.aidl
similarity index 87%
copy from gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
copy to radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimTypeInfo.aidl
index ae709d4..cba5dd9 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimTypeInfo.aidl
@@ -31,14 +31,10 @@
// 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.gnss.gnss_assistance;
+package android.hardware.radio.config;
/* @hide */
-@VintfStability
-parcelable TimeOfClock {
- int year;
- int month;
- int day;
- int hour;
- int minute;
- int seconds;
+@JavaDerive(toString=true) @VintfStability
+parcelable SimTypeInfo {
+ android.hardware.radio.config.SimType currentSimType = android.hardware.radio.config.SimType.UNKNOWN;
+ int supportedSimTypes;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataCallFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataCallFailCause.aidl
index 17d3fda..1f8cbdc 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataCallFailCause.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataCallFailCause.aidl
@@ -169,6 +169,9 @@
MAX_PPP_INACTIVITY_TIMER_EXPIRED = 0x7FE,
IPV6_ADDRESS_TRANSFER_FAILED = 0x7FF,
TRAT_SWAP_FAILED = 0x800,
+ /**
+ * @deprecated Legacy CDMA is unsupported.
+ */
EHRPD_TO_HRPD_FALLBACK = 0x801,
MIP_CONFIG_FAILURE = 0x802,
PDN_INACTIVITY_TIMER_EXPIRED = 0x803,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ResetNvType.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ResetNvType.aidl
index e9937f0..33c0d70 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ResetNvType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ResetNvType.aidl
@@ -36,6 +36,12 @@
@Backing(type="int") @JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @VintfStability
enum ResetNvType {
RELOAD,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
ERASE,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
FACTORY_RESET,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioAccessFamily.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioAccessFamily.aidl
index b400bbe..471916f 100644
--- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioAccessFamily.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioAccessFamily.aidl
@@ -39,7 +39,13 @@
GPRS = (1 << android.hardware.radio.RadioTechnology.GPRS) /* 2 */,
EDGE = (1 << android.hardware.radio.RadioTechnology.EDGE) /* 4 */,
UMTS = (1 << android.hardware.radio.RadioTechnology.UMTS) /* 8 */,
+ /**
+ * @deprecated Legacy CDMA is unsupported.
+ */
IS95A = (1 << android.hardware.radio.RadioTechnology.IS95A) /* 16 */,
+ /**
+ * @deprecated Legacy CDMA is unsupported.
+ */
IS95B = (1 << android.hardware.radio.RadioTechnology.IS95B) /* 32 */,
/**
* @deprecated Legacy CDMA is unsupported.
@@ -60,6 +66,9 @@
* @deprecated Legacy CDMA is unsupported.
*/
EVDO_B = (1 << android.hardware.radio.RadioTechnology.EVDO_B) /* 4096 */,
+ /**
+ * @deprecated Legacy CDMA is unsupported.
+ */
EHRPD = (1 << android.hardware.radio.RadioTechnology.EHRPD) /* 8192 */,
LTE = (1 << android.hardware.radio.RadioTechnology.LTE) /* 16384 */,
HSPAP = (1 << android.hardware.radio.RadioTechnology.HSPAP) /* 32768 */,
@@ -71,4 +80,5 @@
*/
LTE_CA = (1 << android.hardware.radio.RadioTechnology.LTE_CA) /* 524288 */,
NR = (1 << android.hardware.radio.RadioTechnology.NR) /* 1048576 */,
+ NB_IOT_NTN = (1 << android.hardware.radio.RadioTechnology.NB_IOT_NTN) /* 2097152 */,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnology.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnology.aidl
index 7d2d08c..201e694 100644
--- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnology.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnology.aidl
@@ -39,7 +39,13 @@
GPRS,
EDGE,
UMTS,
+ /**
+ * @deprecated Legacy CDMA is unsupported.
+ */
IS95A,
+ /**
+ * @deprecated Legacy CDMA is unsupported.
+ */
IS95B,
/**
* @deprecated Legacy CDMA is unsupported.
@@ -60,6 +66,9 @@
* @deprecated Legacy CDMA is unsupported.
*/
EVDO_B,
+ /**
+ * @deprecated Legacy CDMA is unsupported.
+ */
EHRPD,
LTE,
HSPAP,
@@ -71,4 +80,5 @@
*/
LTE_CA,
NR,
+ NB_IOT_NTN,
}
diff --git a/radio/aidl/android/hardware/radio/RadioAccessFamily.aidl b/radio/aidl/android/hardware/radio/RadioAccessFamily.aidl
index 6d38d59..8c10bb9 100644
--- a/radio/aidl/android/hardware/radio/RadioAccessFamily.aidl
+++ b/radio/aidl/android/hardware/radio/RadioAccessFamily.aidl
@@ -27,7 +27,9 @@
GPRS = 1 << RadioTechnology.GPRS,
EDGE = 1 << RadioTechnology.EDGE,
UMTS = 1 << RadioTechnology.UMTS,
+ /** @deprecated Legacy CDMA is unsupported. */
IS95A = 1 << RadioTechnology.IS95A,
+ /** @deprecated Legacy CDMA is unsupported. */
IS95B = 1 << RadioTechnology.IS95B,
/** @deprecated Legacy CDMA is unsupported. */
ONE_X_RTT = 1 << RadioTechnology.ONE_X_RTT,
@@ -40,6 +42,7 @@
HSPA = 1 << RadioTechnology.HSPA,
/** @deprecated Legacy CDMA is unsupported. */
EVDO_B = 1 << RadioTechnology.EVDO_B,
+ /** @deprecated Legacy CDMA is unsupported. */
EHRPD = 1 << RadioTechnology.EHRPD,
LTE = 1 << RadioTechnology.LTE,
HSPAP = 1 << RadioTechnology.HSPAP,
@@ -52,4 +55,8 @@
* 5G NR. This is only use in 5G Standalone mode.
*/
NR = 1 << RadioTechnology.NR,
+ /**
+ * 3GPP NB-IOT (Narrowband Internet of Things) over Non-Terrestrial-Networks technology.
+ */
+ NB_IOT_NTN = 1 << RadioTechnology.NB_IOT_NTN,
}
diff --git a/radio/aidl/android/hardware/radio/RadioTechnology.aidl b/radio/aidl/android/hardware/radio/RadioTechnology.aidl
index cd82ef5..843bfd0 100644
--- a/radio/aidl/android/hardware/radio/RadioTechnology.aidl
+++ b/radio/aidl/android/hardware/radio/RadioTechnology.aidl
@@ -25,7 +25,9 @@
GPRS,
EDGE,
UMTS,
+ /** @deprecated Legacy CDMA is unsupported. */
IS95A,
+ /** @deprecated Legacy CDMA is unsupported. */
IS95B,
/** @deprecated Legacy CDMA is unsupported. */
ONE_X_RTT,
@@ -38,6 +40,7 @@
HSPA,
/** @deprecated Legacy CDMA is unsupported. */
EVDO_B,
+ /** @deprecated Legacy CDMA is unsupported. */
EHRPD,
LTE,
/**
@@ -59,4 +62,8 @@
* 5G NR. This is only used in 5G Standalone mode.
*/
NR,
+ /**
+ * 3GPP NB-IOT (Narrowband Internet of Things) over Non-Terrestrial-Networks technology.
+ */
+ NB_IOT_NTN,
}
diff --git a/radio/aidl/android/hardware/radio/config/IRadioConfig.aidl b/radio/aidl/android/hardware/radio/config/IRadioConfig.aidl
index 936315c..e819fe0 100644
--- a/radio/aidl/android/hardware/radio/config/IRadioConfig.aidl
+++ b/radio/aidl/android/hardware/radio/config/IRadioConfig.aidl
@@ -27,6 +27,7 @@
import android.hardware.radio.config.IRadioConfigIndication;
import android.hardware.radio.config.IRadioConfigResponse;
+import android.hardware.radio.config.SimType;
import android.hardware.radio.config.SlotPortMapping;
/** @hide */
@@ -208,4 +209,39 @@
* This is available when android.hardware.telephony is defined.
*/
void getSimultaneousCallingSupport(in int serial);
+
+ /**
+ * Get the sim type information.
+ *
+ * Response provides the current active sim type and supported sim types associated with each
+ * active physical slot ids.
+ *
+ * @param serial Serial number of request.
+ *
+ * Response callback is IRadioConfigResponse.getSimTypeInfoResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
+ */
+ void getSimTypeInfo(in int serial);
+
+ /**
+ * Set the sim type associated with the physical slot id and activate if the sim type is
+ * currently inactive.
+ *
+ * Example: There are 2 active physical slot ids and 3 physical sims(2 pSIM and 1 eSIM). First
+ * physical slot id is always linked pSIM and 2nd physical slot id supports either pSIM/eSIM one
+ * at a time. In order to activate eSIM on 2nd physical slot id, caller should pass
+ * corresponding sim type.
+ *
+ * simTypes[0] = pSIM
+ * simTypes[1] = eSIM
+ *
+ * @param serial Serial number of request.
+ * @param simTypes SimType to be activated on each logical slot
+ *
+ * Response callback is IRadioConfigResponse.setSimTypeResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
+ */
+ void setSimType(in int serial, in SimType[] simTypes);
}
diff --git a/radio/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl b/radio/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl
index 8182cd1..d526c51 100644
--- a/radio/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl
+++ b/radio/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl
@@ -18,6 +18,7 @@
import android.hardware.radio.config.PhoneCapability;
import android.hardware.radio.config.SimSlotStatus;
+import android.hardware.radio.config.SimTypeInfo;
/**
* Interface declaring response functions to solicited radio config requests.
@@ -152,4 +153,40 @@
*/
void getSimultaneousCallingSupportResponse(
in android.hardware.radio.RadioResponseInfo info, in int[] enabledLogicalSlots);
+
+ /**
+ * Response to the asynchronous {@link IRadioConfig#getSimTypeInfo} request.
+ *
+ * @param info Response info struct containing response type, serial number and error
+ * @param simTypeInfos Currently active and supported sim types associated with active
+ * physical slot ids.
+ *
+ * Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:NO_MEMORY
+ * RadioError:INTERNAL_ERR
+ * RadioError:MODEM_ERR
+ */
+ void getSimTypeInfoResponse(
+ in android.hardware.radio.RadioResponseInfo info, in SimTypeInfo[] simTypeInfo);
+
+ /**
+ * Response to the asynchronous {@link IRadioConfig#setSimType} request.
+ *
+ * @param info Response info struct containing response type, serial number 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
+ * RadioError:INTERNAL_ERR
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:MODEM_ERR
+ */
+ void setSimTypeResponse(in android.hardware.radio.RadioResponseInfo info);
}
diff --git a/radio/aidl/android/hardware/radio/config/SimType.aidl b/radio/aidl/android/hardware/radio/config/SimType.aidl
new file mode 100644
index 0000000..fc9915e
--- /dev/null
+++ b/radio/aidl/android/hardware/radio/config/SimType.aidl
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2024 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.config;
+
+/** @hide */
+@VintfStability
+@Backing(type="int")
+@JavaDerive(toString=true)
+enum SimType {
+ /**
+ * Unknown
+ **/
+ UNKNOWN = 0,
+ /**
+ * Physical SIM (can be eUICC capable)
+ **/
+ PHYSICAL = 1 << 0,
+ /**
+ * Embedded SIM
+ **/
+ ESIM = 1 << 1,
+}
diff --git a/radio/aidl/android/hardware/radio/config/SimTypeInfo.aidl b/radio/aidl/android/hardware/radio/config/SimTypeInfo.aidl
new file mode 100644
index 0000000..0534626
--- /dev/null
+++ b/radio/aidl/android/hardware/radio/config/SimTypeInfo.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2024 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.config;
+
+import android.hardware.radio.config.SimType;
+
+/** @hide */
+@VintfStability
+@JavaDerive(toString=true)
+parcelable SimTypeInfo {
+ /**
+ * Current SimType on the physical slot id.
+ **/
+ SimType currentSimType = SimType.UNKNOWN;
+ /**
+ * Bitmask of the sim types supported by the physical slot id. Physical slot can support more
+ * than one SimType.
+ * Example:
+ * if the physical slot id supports either pSIM/eSIM and currently pSIM is active,
+ * currentSimType will be SimType::PHYSICAL and supportedSimTypes will be
+ * SimType::PHYSICAL | SimType::ESIM.
+ **/
+ int supportedSimTypes;
+}
diff --git a/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl b/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl
index 5ae057a..592fde6 100644
--- a/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl
+++ b/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl
@@ -421,6 +421,7 @@
TRAT_SWAP_FAILED = 0x800,
/**
* Device falls back from eHRPD to HRPD.
+ * @deprecated Legacy CDMA is unsupported.
*/
EHRPD_TO_HRPD_FALLBACK = 0x801,
/**
diff --git a/radio/aidl/android/hardware/radio/modem/IRadioModem.aidl b/radio/aidl/android/hardware/radio/modem/IRadioModem.aidl
index 491657c..15a833e 100644
--- a/radio/aidl/android/hardware/radio/modem/IRadioModem.aidl
+++ b/radio/aidl/android/hardware/radio/modem/IRadioModem.aidl
@@ -139,12 +139,13 @@
void nvReadItem(in int serial, in NvItem itemId);
/**
- * Reset the radio NV configuration.
+ * Reboots modem.
*
- * This is also used to reboot the modem with ResetNvType.RELOAD.
+ * This was historically used to reset NV configuration, but starting from Android U, NV APIs
+ * are deprecated.
*
* @param serial Serial number of request.
- * @param resetType Type of reset operation
+ * @param resetType Always ResetNvType.RELOAD.
*
* Response function is IRadioModemResponse.nvResetConfigResponse()
*/
diff --git a/radio/aidl/android/hardware/radio/modem/ResetNvType.aidl b/radio/aidl/android/hardware/radio/modem/ResetNvType.aidl
index 71736d8..95fa0d7 100644
--- a/radio/aidl/android/hardware/radio/modem/ResetNvType.aidl
+++ b/radio/aidl/android/hardware/radio/modem/ResetNvType.aidl
@@ -25,15 +25,21 @@
@SuppressWarnings(value={"redundant-name"})
enum ResetNvType {
/**
- * Reload all NV items. This may reboot modem.
+ * Reboot modem.
+ *
+ * Historically, this has been also reloading all NV items.
*/
RELOAD,
/**
* Erase NV reset (SCRTN)
+ *
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
ERASE,
/**
* Factory reset (RTN)
+ *
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
FACTORY_RESET,
}
diff --git a/radio/aidl/compat/libradiocompat/config/RadioConfig.cpp b/radio/aidl/compat/libradiocompat/config/RadioConfig.cpp
index 837c626..3834ecc 100644
--- a/radio/aidl/compat/libradiocompat/config/RadioConfig.cpp
+++ b/radio/aidl/compat/libradiocompat/config/RadioConfig.cpp
@@ -109,4 +109,19 @@
return ok();
}
+ScopedAStatus RadioConfig::getSimTypeInfo(int32_t serial) {
+ LOG_CALL << serial;
+ LOG(ERROR) << " getSimTypeInfo is unsupported by HIDL HALs";
+ respond()->getSimTypeInfoResponse(notSupported(serial), {});
+ return ok();
+}
+
+ScopedAStatus RadioConfig::setSimType(
+ int32_t serial, const std::vector<aidl::SimType>& /*simTypes*/) {
+ LOG_CALL << serial;
+ LOG(ERROR) << " setSimType is unsupported by HIDL HALs";
+ respond()->setSimTypeResponse(notSupported(serial));
+ return ok();
+}
+
} // namespace android::hardware::radio::compat
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h
index 17d5985..a1e48dc 100644
--- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h
@@ -55,7 +55,11 @@
int32_t serial,
const std::vector<aidl::android::hardware::radio::config::SlotPortMapping>& slotMap)
override;
-
+ ::ndk::ScopedAStatus getSimTypeInfo(int32_t serial) override;
+ ::ndk::ScopedAStatus setSimType(
+ int32_t serial,
+ const std::vector<aidl::android::hardware::radio::config::SimType>& simTypes)
+ override;
protected:
std::shared_ptr<::aidl::android::hardware::radio::config::IRadioConfigResponse> respond();
diff --git a/radio/aidl/vts/radio_config_response.cpp b/radio/aidl/vts/radio_config_response.cpp
index c532440..49439fa 100644
--- a/radio/aidl/vts/radio_config_response.cpp
+++ b/radio/aidl/vts/radio_config_response.cpp
@@ -75,3 +75,17 @@
parent_config.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
+
+ndk::ScopedAStatus RadioConfigResponse::getSimTypeInfoResponse(const RadioResponseInfo& info,
+ const std::vector<SimTypeInfo>& /* simTypeInfo */) {
+ rspInfo = info;
+ parent_config.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioConfigResponse::setSimTypeResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_config.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
diff --git a/radio/aidl/vts/radio_config_utils.h b/radio/aidl/vts/radio_config_utils.h
index 84c74fc..cdcc1bc 100644
--- a/radio/aidl/vts/radio_config_utils.h
+++ b/radio/aidl/vts/radio_config_utils.h
@@ -62,6 +62,11 @@
virtual ndk::ScopedAStatus getHalDeviceCapabilitiesResponse(
const RadioResponseInfo& info, bool modemReducedFeatureSet1) override;
+
+ virtual ndk::ScopedAStatus getSimTypeInfoResponse(
+ const RadioResponseInfo& info, const std::vector<SimTypeInfo>& simTypeInfo) override;
+
+ virtual ndk::ScopedAStatus setSimTypeResponse(const RadioResponseInfo& info) override;
};
/* Callback class for radio config indication */
diff --git a/security/keymint/aidl/vts/functional/BootloaderStateTest.cpp b/security/keymint/aidl/vts/functional/BootloaderStateTest.cpp
index 083a9aa..b41da3f 100644
--- a/security/keymint/aidl/vts/functional/BootloaderStateTest.cpp
+++ b/security/keymint/aidl/vts/functional/BootloaderStateTest.cpp
@@ -95,6 +95,18 @@
<< "Verified boot state must be \"UNVERIFIED\" aka \"orange\".";
}
+// Check that the attested Verified Boot key is 32 bytes of zeroes since the bootloader is unlocked.
+TEST_P(BootloaderStateTest, VerifiedBootKeyAllZeroes) {
+ // Gate this test to avoid waiver issues.
+ if (get_vsr_api_level() <= __ANDROID_API_V__) {
+ return;
+ }
+
+ std::vector<uint8_t> expectedVbKey(32, 0);
+ ASSERT_EQ(attestedVbKey_, expectedVbKey) << "Verified Boot key digest must be 32 bytes of "
+ "zeroes since the bootloader is unlocked.";
+}
+
// Following error codes from avb_slot_data() mean that slot data was loaded
// (even if verification failed).
static inline bool avb_slot_data_loaded(AvbSlotVerifyResult result) {
diff --git a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp
index 0ce6a15..09446ce 100644
--- a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp
+++ b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp
@@ -1908,16 +1908,29 @@
}
}
+ if (get_vsr_api_level() > __ANDROID_API_V__) {
+ // The Verified Boot key field should be exactly 32 bytes since it
+ // contains the SHA-256 hash of the key on locked devices or 32 bytes
+ // of zeroes on unlocked devices. This wasn't checked for earlier
+ // versions of the KeyMint HAL, so only only be strict for VSR-16+.
+ EXPECT_EQ(verified_boot_key.size(), 32);
+ } else if (get_vsr_api_level() == __ANDROID_API_V__) {
+ // The Verified Boot key field should be:
+ // - Exactly 32 bytes on locked devices since it should contain
+ // the SHA-256 hash of the key, or
+ // - Up to 32 bytes of zeroes on unlocked devices (behaviour on
+ // unlocked devices isn't specified in the HAL interface
+ // specification).
+ // Thus, we can't check for strict equality in case unlocked devices
+ // report values with less than 32 bytes. This wasn't checked for
+ // earlier versions of the KeyMint HAL, so only check on VSR-15.
+ EXPECT_LE(verified_boot_key.size(), 32);
+ }
+
// Verified Boot key should be all zeroes if the boot state is "orange".
std::string empty_boot_key(32, '\0');
std::string verified_boot_key_str((const char*)verified_boot_key.data(),
verified_boot_key.size());
- if (get_vsr_api_level() >= __ANDROID_API_V__) {
- // The attestation should contain the SHA-256 hash of the verified boot
- // key. However, this was not checked for earlier versions of the KeyMint
- // HAL so only be strict for VSR-V and above.
- EXPECT_LE(verified_boot_key.size(), 32);
- }
EXPECT_NE(property_get("ro.boot.verifiedbootstate", property_value, ""), 0);
if (!strcmp(property_value, "green")) {
EXPECT_EQ(verified_boot_state, VerifiedBoot::VERIFIED);
diff --git a/security/keymint/aidl/vts/functional/SecureElementProvisioningTest.cpp b/security/keymint/aidl/vts/functional/SecureElementProvisioningTest.cpp
index 9f7322a..f7639bf 100644
--- a/security/keymint/aidl/vts/functional/SecureElementProvisioningTest.cpp
+++ b/security/keymint/aidl/vts/functional/SecureElementProvisioningTest.cpp
@@ -114,10 +114,22 @@
const auto& vbKey = rot->asArray()->get(pos++);
ASSERT_TRUE(vbKey);
ASSERT_TRUE(vbKey->asBstr());
- if (get_vsr_api_level() >= __ANDROID_API_V__) {
- // The attestation should contain the SHA-256 hash of the verified boot
- // key. However, this not was checked for earlier versions of the KeyMint
- // HAL so only be strict for VSR-V and above.
+ if (get_vsr_api_level() > __ANDROID_API_V__) {
+ // The Verified Boot key field should be exactly 32 bytes since it
+ // contains the SHA-256 hash of the key on locked devices or 32 bytes
+ // of zeroes on unlocked devices. This wasn't checked for earlier
+ // versions of the KeyMint HAL, so only only be strict for VSR-16+.
+ ASSERT_EQ(vbKey->asBstr()->value().size(), 32);
+ } else if (get_vsr_api_level() == __ANDROID_API_V__) {
+ // The Verified Boot key field should be:
+ // - Exactly 32 bytes on locked devices since it should contain
+ // the SHA-256 hash of the key, or
+ // - Up to 32 bytes of zeroes on unlocked devices (behaviour on
+ // unlocked devices isn't specified in the HAL interface
+ // specification).
+ // Thus, we can't check for strict equality in case unlocked devices
+ // report values with less than 32 bytes. This wasn't checked for
+ // earlier versions of the KeyMint HAL, so only check on VSR-15.
ASSERT_LE(vbKey->asBstr()->value().size(), 32);
}
diff --git a/security/secretkeeper/aidl/Android.bp b/security/secretkeeper/aidl/Android.bp
index d282621..f0b7894 100644
--- a/security/secretkeeper/aidl/Android.bp
+++ b/security/secretkeeper/aidl/Android.bp
@@ -25,7 +25,7 @@
"android.hardware.security.authgraph-V1",
],
stability: "vintf",
- frozen: true,
+ frozen: false,
backend: {
java: {
enabled: true,
@@ -88,6 +88,6 @@
rust_defaults {
name: "secretkeeper_use_latest_hal_aidl_rust",
rustlibs: [
- "android.hardware.security.secretkeeper-V1-rust",
+ "android.hardware.security.secretkeeper-V2-rust",
],
}
diff --git a/security/secretkeeper/aidl/aidl_api/android.hardware.security.secretkeeper/current/android/hardware/security/secretkeeper/ISecretkeeper.aidl b/security/secretkeeper/aidl/aidl_api/android.hardware.security.secretkeeper/current/android/hardware/security/secretkeeper/ISecretkeeper.aidl
index 8ce37cd..ed48480 100644
--- a/security/secretkeeper/aidl/aidl_api/android.hardware.security.secretkeeper/current/android/hardware/security/secretkeeper/ISecretkeeper.aidl
+++ b/security/secretkeeper/aidl/aidl_api/android.hardware.security.secretkeeper/current/android/hardware/security/secretkeeper/ISecretkeeper.aidl
@@ -38,6 +38,7 @@
byte[] processSecretManagementRequest(in byte[] request);
void deleteIds(in android.hardware.security.secretkeeper.SecretId[] ids);
void deleteAll();
+ android.hardware.security.secretkeeper.PublicKey getSecretkeeperIdentity();
const int ERROR_UNKNOWN_KEY_ID = 1;
const int ERROR_INTERNAL_ERROR = 2;
const int ERROR_REQUEST_MALFORMED = 3;
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl b/security/secretkeeper/aidl/aidl_api/android.hardware.security.secretkeeper/current/android/hardware/security/secretkeeper/PublicKey.aidl
similarity index 91%
rename from gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
rename to security/secretkeeper/aidl/aidl_api/android.hardware.security.secretkeeper/current/android/hardware/security/secretkeeper/PublicKey.aidl
index ae709d4..f690abf 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
+++ b/security/secretkeeper/aidl/aidl_api/android.hardware.security.secretkeeper/current/android/hardware/security/secretkeeper/PublicKey.aidl
@@ -31,14 +31,9 @@
// 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.gnss.gnss_assistance;
+package android.hardware.security.secretkeeper;
/* @hide */
@VintfStability
-parcelable TimeOfClock {
- int year;
- int month;
- int day;
- int hour;
- int minute;
- int seconds;
+parcelable PublicKey {
+ byte[] keyMaterial;
}
diff --git a/security/secretkeeper/aidl/android/hardware/security/secretkeeper/ISecretkeeper.aidl b/security/secretkeeper/aidl/android/hardware/security/secretkeeper/ISecretkeeper.aidl
index b07dba8..91493a1 100644
--- a/security/secretkeeper/aidl/android/hardware/security/secretkeeper/ISecretkeeper.aidl
+++ b/security/secretkeeper/aidl/android/hardware/security/secretkeeper/ISecretkeeper.aidl
@@ -17,6 +17,7 @@
package android.hardware.security.secretkeeper;
import android.hardware.security.authgraph.IAuthGraphKeyExchange;
+import android.hardware.security.secretkeeper.PublicKey;
import android.hardware.security.secretkeeper.SecretId;
@VintfStability
@@ -101,4 +102,12 @@
* Delete data of all clients.
*/
void deleteAll();
+
+ /**
+ * Gets the public key of the secret keeper instance. This should be a CBOR-encoded
+ * COSE_Key, as a PubKeyEd25519 / PubKeyECDSA256 / PubKeyECDSA384, as defined in
+ * generateCertificateRequestV2.cddl. Clients must have a trusted way of ensuring
+ * this key is valid.
+ */
+ PublicKey getSecretkeeperIdentity();
}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl b/security/secretkeeper/aidl/android/hardware/security/secretkeeper/PublicKey.aidl
similarity index 61%
rename from gnss/aidl/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
rename to security/secretkeeper/aidl/android/hardware/security/secretkeeper/PublicKey.aidl
index 7b9cc9f..ccc89b3 100644
--- a/gnss/aidl/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
+++ b/security/secretkeeper/aidl/android/hardware/security/secretkeeper/PublicKey.aidl
@@ -14,30 +14,16 @@
* limitations under the License.
*/
-package android.hardware.gnss.gnss_assistance;
+package android.hardware.security.secretkeeper;
-/*
- * Contains the reference time of the GNSS clock.
- *
+/**
+ * Contents of a pubkey.
* @hide
*/
@VintfStability
-parcelable TimeOfClock {
- /** Year of the clock. */
- int year;
-
- /** Month of the clock. */
- int month;
-
- /** Day of the clock. */
- int day;
-
- /** Hour of the clock. */
- int hour;
-
- /** Minute of the clock. */
- int minute;
-
- /** Second of the clock. */
- int seconds;
+parcelable PublicKey {
+ /**
+ * CBOR-encoded COSE_Key
+ */
+ byte[] keyMaterial;
}
diff --git a/security/secretkeeper/aidl/vts/Android.bp b/security/secretkeeper/aidl/vts/Android.bp
index be07a7b..c84afae 100644
--- a/security/secretkeeper/aidl/vts/Android.bp
+++ b/security/secretkeeper/aidl/vts/Android.bp
@@ -38,6 +38,7 @@
srcs: ["secretkeeper_test_client.rs"],
defaults: [
"rdroidtest.defaults",
+ "secretkeeper_use_latest_hal_aidl_rust",
],
test_suites: [
"general-tests",
@@ -45,7 +46,6 @@
],
test_config: "AndroidTest.xml",
rustlibs: [
- "android.hardware.security.secretkeeper-V1-rust",
"libauthgraph_boringssl",
"libauthgraph_core",
"libauthgraph_wire",
@@ -66,9 +66,10 @@
rust_binary {
name: "secretkeeper_cli",
srcs: ["secretkeeper_cli.rs"],
+ defaults: ["secretkeeper_use_latest_hal_aidl_rust"],
lints: "android",
- rlibs: [
- "android.hardware.security.secretkeeper-V1-rust",
+ prefer_rlib: true,
+ rustlibs: [
"libanyhow",
"libauthgraph_boringssl",
"libauthgraph_core",
diff --git a/security/secretkeeper/aidl/vts/secretkeeper_test_client.rs b/security/secretkeeper/aidl/vts/secretkeeper_test_client.rs
index 449a99a..b944865 100644
--- a/security/secretkeeper/aidl/vts/secretkeeper_test_client.rs
+++ b/security/secretkeeper/aidl/vts/secretkeeper_test_client.rs
@@ -16,6 +16,7 @@
use android_hardware_security_secretkeeper::aidl::android::hardware::security::secretkeeper::ISecretkeeper::ISecretkeeper;
use android_hardware_security_secretkeeper::aidl::android::hardware::security::secretkeeper::SecretId::SecretId;
+use android_hardware_security_secretkeeper::aidl::android::hardware::security::secretkeeper::PublicKey::PublicKey;
use authgraph_vts_test as ag_vts;
use authgraph_boringssl as boring;
use authgraph_core::key;
@@ -70,20 +71,32 @@
0x06, 0xAC, 0x36, 0x8B, 0x3C, 0x95, 0x50, 0x16, 0x67, 0x71, 0x65, 0x26, 0xEB, 0xD0, 0xC3, 0x98,
]);
-// Android expects the public key of Secretkeeper instance to be present in the Linux device tree.
+// Android expects the public key of Secretkeeper instance to be available either
+// a) by being present in the Linux device tree (prior to version 2 of the secretkeeper HAL), or
+// b) via the `getSecretKeeperIdentity` operation from v2 onwards.
// This allows clients to (cryptographically) verify that they are indeed talking to the real
// secretkeeper.
// Note that this is the identity of the `default` instance (and not `nonsecure`)!
-fn get_secretkeeper_identity() -> Option<CoseKey> {
- let path = Path::new(SECRETKEEPER_KEY_HOST_DT);
- if path.exists() {
- let key = fs::read(path).unwrap();
- let mut key = CoseKey::from_slice(&key).unwrap();
- key.canonicalize(CborOrdering::Lexicographic);
- Some(key)
+fn get_secretkeeper_identity(instance: &str) -> Option<CoseKey> {
+ let sk = get_connection(instance);
+ let key_material = if sk.getInterfaceVersion().expect("Error getting sk interface version") >= 2 {
+ let PublicKey { keyMaterial } = sk.getSecretkeeperIdentity().expect("Error calling getSecretkeeperIdentity");
+ Some(keyMaterial)
} else {
- None
- }
+ let path = Path::new(SECRETKEEPER_KEY_HOST_DT);
+ if path.exists() {
+ let key_material = fs::read(path).unwrap();
+ Some(key_material)
+ } else {
+ None
+ }
+ };
+
+ key_material.map(|km| {
+ let mut cose_key = CoseKey::from_slice(&km).expect("Error deserializing CoseKey from key material");
+ cose_key.canonicalize(CborOrdering::Lexicographic);
+ cose_key
+ })
}
fn get_instances() -> Vec<(String, String)> {
@@ -760,12 +773,12 @@
}
// This test checks that the identity of Secretkeeper (in context of AuthGraph key exchange) is
-// same as the one advertized in Linux device tree. This is only expected from `default` instance.
+// same as the one either a) advertized in Linux device tree or b) retrieved from SK itself
+// from (HAL v2 onwards). This is only expected from `default` instance.
#[rdroidtest(get_instances())]
-#[ignore_if(|p| p != "default")]
fn secretkeeper_check_identity(instance: String) {
- let sk_key = get_secretkeeper_identity()
- .expect("Failed to extract identity of default instance from device tree");
+ let sk_key = get_secretkeeper_identity(&instance)
+ .expect("Failed to extract identity of default instance");
// Create a session with this expected identity. This succeeds only if the identity used by
// Secretkeeper is sk_key.
let _ = SkClient::with_expected_sk_identity(&instance, sk_key).unwrap();
diff --git a/security/secretkeeper/default/Android.bp b/security/secretkeeper/default/Android.bp
index 799188f..134afc9 100644
--- a/security/secretkeeper/default/Android.bp
+++ b/security/secretkeeper/default/Android.bp
@@ -28,9 +28,9 @@
vendor_available: true,
defaults: [
"authgraph_use_latest_hal_aidl_rust",
+ "secretkeeper_use_latest_hal_aidl_rust",
],
rustlibs: [
- "android.hardware.security.secretkeeper-V1-rust",
"libauthgraph_boringssl",
"libauthgraph_core",
"libauthgraph_hal",
@@ -50,9 +50,9 @@
prefer_rlib: true,
defaults: [
"authgraph_use_latest_hal_aidl_rust",
+ "secretkeeper_use_latest_hal_aidl_rust",
],
rustlibs: [
- "android.hardware.security.secretkeeper-V1-rust",
"libandroid_logger",
"libbinder_rs",
"liblog_rust",
diff --git a/security/secretkeeper/default/secretkeeper.xml b/security/secretkeeper/default/secretkeeper.xml
index 40aebe0..699fff0 100644
--- a/security/secretkeeper/default/secretkeeper.xml
+++ b/security/secretkeeper/default/secretkeeper.xml
@@ -19,7 +19,7 @@
<hal format="aidl">
<name>android.hardware.security.secretkeeper</name>
- <version>1</version>
+ <version>2</version>
<interface>
<name>ISecretkeeper</name>
<instance>nonsecure</instance>
diff --git a/security/see/hdcp/README.md b/security/see/hdcp/README.md
new file mode 100644
index 0000000..76b8670
--- /dev/null
+++ b/security/see/hdcp/README.md
@@ -0,0 +1,65 @@
+# IHDCPAuthControl as a Trusted HAL service
+
+IHDCPAuthControl is expected to be a service implemented in a TEE.
+We provide a default reference implementation and its integration in Trusty
+as an example.
+
+The VTS test for a Trusted HAL service ought to run in the VM.
+We provide an integration of the VTS test in a Trusty VM,
+and later in a Microdroid VM (b/380632474).
+
+This interface shall not be exposed to the host and thus shall be part of
+the list of excluded interfaces from
+[compatibility_matrices/exclude/fcm_exclude.cpp](../../../compatibility_matrices/exclude/fcm_exclude.cpp)
+
+## 1. Mock Implementation
+
+The mock implementation under default/src/lib.rs is expected to be integrated in a
+TEE. For AOSP testing we offer two virtual device testing options:
+
+- Cuttlefish AVD, where the reference implementation is integrated in an AVF VM, emulating a TEE.
+- Trusty QEMU AVD, where the reference implementation is integrated in a Trusty TEE image (executed in secure world)
+
+### 1.1. Cuttlefish: Integrate in an AVF HAL pVM (Trusty)
+
+In Cuttlefish, we emulate a TEE with an AVF Trusty pVM.
+The VM2TZ IPC is emulated with a vsock port forward utility (b/379582767).
+
+Until vsock port forwarding is supported, the trusty_test_vm is used temporarily.
+(VTS tests and HAL implementation will be in same pVM).
+
+TODO: complete when trusty_hal_vm is created
+
+In order to add the mock HdcpAuthControlService to the trusty_test_vm, make sure
+that `hardware/interfaces/security/see/hdcp/default` is added to the
+trusty_test_vm makefile, by adding it to
+[trusty/device/x86/generic-x86_64/project/generic-x86_64-inc.mk](../../../../../trusty/device/x86/generic-x86_64/project/generic-x86_64-inc.mk)
+
+### 1.2. Trusty QEMU AVD: Integrate as a TA in Trusty TEE
+
+In order to add the mock HdcpAuthControlService to the Trusty TEE, make sure
+that `hardware/interfaces/security/see/hdcp/default` is added to
+[trusty/device/arm/generic-arm64/project/generic-arm-inc.mk](../../../../../trusty/device/arm/generic-arm64/project/generic-arm-inc.mk)
+
+
+## 2. VTS Tests
+
+IHdcpAuthControl service is expected to only be exposed to AVF pVM.
+
+The VTS tests shall verify:
+
+- IHdcpAuthControl cannot be accessed from the Android Host:
+
+ see [aidl/vts/src/host_test.rs](aidl/vts/host_test.rs)
+
+- IHdcpAuthControl can be accessed from an AVF pVM:
+
+ see [aidl/vts/src/vm_test.rs](aidl/vts/src/vm_test.rs)
+ see [aidl/vts/AndroidTest.xml](aidl/vts/AndroidTest.xml)
+
+
+To integrate the VTS test in the trusty_test_vm:
+
+1.
+1. add the test to [hardware/interfaces/security/see/usertests-rust-inc.mk](../usertests-rust-inc.mk)
+
diff --git a/security/see/hdcp/aidl/Android.bp b/security/see/hdcp/aidl/Android.bp
new file mode 100644
index 0000000..ad1db37
--- /dev/null
+++ b/security/see/hdcp/aidl/Android.bp
@@ -0,0 +1,57 @@
+// Copyright (C) 2024 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package {
+ default_team: "trendy_team_trusty",
+ default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+aidl_interface {
+ name: "android.hardware.security.see.hdcp",
+ vendor_available: true,
+ srcs: ["android/hardware/security/see/hdcp/*.aidl"],
+ imports: [
+ "android.hardware.drm.common-V1",
+ ],
+ stability: "vintf",
+ frozen: false,
+ backend: {
+ java: {
+ enabled: false,
+ },
+ cpp: {
+ enabled: false,
+ },
+ ndk: {
+ min_sdk_version: "34",
+ },
+ rust: {
+ enabled: true,
+ gen_mockall: true,
+ additional_rustlibs: [
+ "libmockall",
+ ],
+ },
+ },
+}
+
+// A rust_defaults that includes the latest hdcp AIDL library.
+// Modules that depend on hdcp directly can include this rust_defaults to avoid
+// managing dependency versions explicitly.
+rust_defaults {
+ name: "hdcp_use_latest_hal_aidl_rust",
+ rustlibs: [
+ "android.hardware.security.see.hdcp-V1-rust",
+ ],
+}
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ValueRange.aidl b/security/see/hdcp/aidl/aidl_api/android.hardware.security.see.hdcp/current/android/hardware/security/see/hdcp/IHdcpAuthControl.aidl
similarity index 63%
copy from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ValueRange.aidl
copy to security/see/hdcp/aidl/aidl_api/android.hardware.security.see.hdcp/current/android/hardware/security/see/hdcp/IHdcpAuthControl.aidl
index 077652b..b73d554 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ValueRange.aidl
+++ b/security/see/hdcp/aidl/aidl_api/android.hardware.security.see.hdcp/current/android/hardware/security/see/hdcp/IHdcpAuthControl.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2024 The Android Open Source Project
+ * Copyright 2024 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,10 +31,28 @@
// 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.automotive.vehicle;
-@JavaDerive(equals=true, toString=true) @RustDerive(Clone=true) @VintfStability
-parcelable ValueRange {
- @nullable android.hardware.automotive.vehicle.RawPropValues minValue;
- @nullable android.hardware.automotive.vehicle.RawPropValues maxValue;
- @nullable List<android.hardware.automotive.vehicle.RawPropValues> supportedValues;
+package android.hardware.security.see.hdcp;
+@VintfStability
+interface IHdcpAuthControl {
+ android.hardware.drm.HdcpLevels getHdcpLevels();
+ void trySetHdcpLevel(in android.hardware.drm.HdcpLevel level);
+ android.hardware.security.see.hdcp.IHdcpAuthControl.PendingHdcpLevelResult getPendingHdcpLevel();
+ parcelable HalErrorCode {
+ const int NO_ERROR = 0;
+ const int GENERIC_ERROR = (-1) /* -1 */;
+ const int BAD_STATE = (-2) /* -2 */;
+ const int UNSUPPORTED = (-3) /* -3 */;
+ const int SERIALIZATION_ERROR = (-4) /* -4 */;
+ const int ALLOCATION_ERROR = (-5) /* -5 */;
+ const int BAD_PARAMETER = (-7) /* -7 */;
+ const int UNAUTHORIZED = (-8) /* -8 */;
+ }
+ parcelable PendingHdcpLevelResult {
+ android.hardware.security.see.hdcp.IHdcpAuthControl.PendingHdcpLevelResult.Status status;
+ android.hardware.drm.HdcpLevel level;
+ enum Status {
+ NONE,
+ PENDING,
+ }
+ }
}
diff --git a/security/see/hdcp/aidl/android/hardware/security/see/hdcp/IHdcpAuthControl.aidl b/security/see/hdcp/aidl/android/hardware/security/see/hdcp/IHdcpAuthControl.aidl
new file mode 100644
index 0000000..b9a1fe5
--- /dev/null
+++ b/security/see/hdcp/aidl/android/hardware/security/see/hdcp/IHdcpAuthControl.aidl
@@ -0,0 +1,125 @@
+/*
+ * Copyright 2024 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.security.see.hdcp;
+
+/**
+ * IHdcpAuthControl is used by the OEMCrypto Trusted Application to interact
+ * with a HDCP Encryption Trusted Application in order to control the
+ * HDCP Authentication Levels.
+ */
+@VintfStability
+interface IHdcpAuthControl {
+ /*
+ * Service error codes. Will be returned as service specific errors.
+ */
+ parcelable HalErrorCode {
+ /* Success */
+ const int NO_ERROR = 0;
+
+ /* Generic error */
+ const int GENERIC_ERROR = -1;
+
+ /* Desired operation cannot be performed because of the server current state */
+ const int BAD_STATE = -2;
+
+ /* Operation or parameters are not supported by the server */
+ const int UNSUPPORTED = -3;
+
+ /* Error encountered when parsing parameters */
+ const int SERIALIZATION_ERROR = -4;
+
+ /* Server ran out of memory when performing operation */
+ const int ALLOCATION_ERROR = -5;
+
+ /* Bad parameter supplied for the desired operation */
+ const int BAD_PARAMETER = -7;
+
+ /* Caller is not authorized to make this call */
+ const int UNAUTHORIZED = -8;
+ }
+ /**
+ * Result returned from the getPendingHdcpLevelResult API.
+ */
+ parcelable PendingHdcpLevelResult {
+ enum Status {
+ /**
+ * No pending HdcpLevel request
+ */
+ NONE,
+ /**
+ * a HdcpLevel request is pending, its level is provided in the
+ * |level| attribute
+ */
+ PENDING,
+ }
+ Status status;
+ android.hardware.drm.HdcpLevel level;
+ }
+
+ /**
+ * Return the currently negotiated and max supported HDCP levels.
+ *
+ * The current level is based on the display(s) the device is connected to.
+ * If multiple HDCP-capable displays are simultaneously connected to
+ * separate interfaces, this method returns the lowest negotiated HDCP level
+ * of all interfaces.
+ *
+ * The maximum HDCP level is the highest level that can potentially be
+ * negotiated. It is a constant for any device, i.e. it does not depend on
+ * downstream receiving devices that could be connected. For example, if
+ * the device has HDCP 1.x keys and is capable of negotiating HDCP 1.x, but
+ * does not have HDCP 2.x keys, then the maximum HDCP capability would be
+ * reported as 1.x. If multiple HDCP-capable interfaces are present, it
+ * indicates the highest of the maximum HDCP levels of all interfaces.
+ *
+ * This method should only be used for informational purposes, not for
+ * enforcing compliance with HDCP requirements. Trusted enforcement of HDCP
+ * policies must be handled by the DRM system.
+ *
+ * @return HdcpLevels parcelable
+ */
+ android.hardware.drm.HdcpLevels getHdcpLevels();
+
+ /**
+ * Attempts to set the device's HDCP auth level to |level|.
+ *
+ * @param level: desired HDCP level
+ *
+ * @return:
+ * a service specific error based on <code>HalErrorCode</code>,
+ * specifically:
+ * + BAD_PARAMETER: when HDCP_UNKNOWN is requested
+ * + UNSUPPORTED: when |level| is greater than the MaxLevel supported
+ * + BAD_STATE: when the HDCP's service currentLevel is HDCP_NO_OUTPUT
+ *
+ */
+ void trySetHdcpLevel(in android.hardware.drm.HdcpLevel level);
+
+ /**
+ * Retrieve the pending level currently being processed by the HDCP service.
+ * The pending HDCP protection level might be higher than the level initially
+ * requested. This can occur when multiple applications or services are
+ * using HDCP concurrently, and a higher level is needed to satisfy
+ * all requirements.
+ *
+ * @return:
+ * PendingHdcpLevelResult on success, which contains a status
+ * and an optional level; on error a service specific error based on
+ * <code>HalErrorCode</code> otherwise.
+ *
+ */
+ PendingHdcpLevelResult getPendingHdcpLevel();
+}
diff --git a/security/see/hdcp/aidl/trusty/drm/rust/rules.mk b/security/see/hdcp/aidl/trusty/drm/rust/rules.mk
new file mode 100644
index 0000000..742b6ab
--- /dev/null
+++ b/security/see/hdcp/aidl/trusty/drm/rust/rules.mk
@@ -0,0 +1,39 @@
+# Copyright (C) 2024 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.
+#
+
+LOCAL_DIR := $(GET_LOCAL_DIR)
+
+MODULE := $(LOCAL_DIR)
+
+AIDL_DIR := hardware/interfaces/drm/aidl
+
+MODULE_AIDL_FLAGS := \
+ --stability=vintf \
+ --version=1 \
+
+MODULE_CRATE_NAME := android_hardware_drm
+
+MODULE_AIDL_LANGUAGE := rust
+
+MODULE_AIDL_PACKAGE := android/hardware/drm
+
+MODULE_AIDL_INCLUDES := \
+ -I $(AIDL_DIR) \
+
+MODULE_AIDLS := \
+ $(AIDL_DIR)/$(MODULE_AIDL_PACKAGE)/HdcpLevel.aidl \
+ $(AIDL_DIR)/$(MODULE_AIDL_PACKAGE)/HdcpLevels.aidl \
+
+include make/aidl.mk
diff --git a/security/see/hdcp/aidl/trusty/hdcp/rust/rules.mk b/security/see/hdcp/aidl/trusty/hdcp/rust/rules.mk
new file mode 100644
index 0000000..beab655
--- /dev/null
+++ b/security/see/hdcp/aidl/trusty/hdcp/rust/rules.mk
@@ -0,0 +1,47 @@
+# Copyright (C) 2024 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.
+#
+
+LOCAL_DIR := $(GET_LOCAL_DIR)
+
+MODULE := $(LOCAL_DIR)
+
+AIDL_DIR := hardware/interfaces/security/see/hdcp/aidl
+DRM_AIDL_DIR := hardware/interfaces/drm/aidl
+
+MODULE_AIDL_FLAGS := \
+ --mockall \
+ --version=1 \
+
+MODULE_CRATE_NAME := android_hardware_security_see_hdcp
+
+MODULE_AIDL_LANGUAGE := rust
+
+MODULE_AIDL_PACKAGE := android/hardware/security/see/hdcp
+
+MODULE_AIDL_INCLUDES := \
+ -I $(AIDL_DIR) \
+ -I $(DRM_AIDL_DIR) \
+
+MODULE_AIDLS := \
+ $(AIDL_DIR)/$(MODULE_AIDL_PACKAGE)/IHdcpAuthControl.aidl \
+
+MODULE_AIDL_RUST_DEPS := \
+ android_hardware_drm
+
+MODULE_LIBRARY_DEPS := \
+ hardware/interfaces/security/see/hdcp/aidl/trusty/drm/rust \
+ $(call FIND_CRATE,mockall) \
+
+include make/aidl.mk
diff --git a/security/see/hdcp/aidl/vts/Android.bp b/security/see/hdcp/aidl/vts/Android.bp
new file mode 100644
index 0000000..eadb9cd
--- /dev/null
+++ b/security/see/hdcp/aidl/vts/Android.bp
@@ -0,0 +1,36 @@
+// Copyright (C) 2024 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: ["Android-Apache-2.0"],
+ default_team: "trendy_team_trusty",
+}
+
+rust_test {
+ name: "VtsAidlHdcpNonExistentTest",
+ srcs: ["src/host_test.rs"],
+ require_root: true,
+ test_suites: [
+ "general-tests",
+ "vts",
+ ],
+ rustlibs: [
+ "libbinder_rs",
+ ],
+}
diff --git a/security/see/hdcp/aidl/vts/src/host_test.rs b/security/see/hdcp/aidl/vts/src/host_test.rs
new file mode 100644
index 0000000..f64de20
--- /dev/null
+++ b/security/see/hdcp/aidl/vts/src/host_test.rs
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+
+//! Test for asserting the non-existence of an IHdcpAuthControl.aidl
+
+#![cfg(test)]
+
+use binder;
+
+const HDCP_INTERFACE_NAME: &str = "android.hardware.security.see.hdcp.IHdcpAuthControl";
+
+#[test]
+fn test_hdcp_auth_control_non_existence() {
+ let hdcp_instances = match binder::get_declared_instances(HDCP_INTERFACE_NAME) {
+ Ok(vec) => vec,
+ Err(e) => {
+ panic!("failed to retrieve the declared interfaces for HdcpAuthControl: {:?}", e);
+ }
+ };
+ assert!(hdcp_instances.is_empty());
+}
diff --git a/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl
index 83b8496..b31a06c 100644
--- a/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl
@@ -44,7 +44,6 @@
android.hardware.security.see.hwcrypto.IOpaqueKey getKeyslotData(android.hardware.security.see.hwcrypto.IHwCryptoKey.KeySlot slotId);
enum DeviceKeyId {
DEVICE_BOUND_KEY,
- BATCH_KEY,
}
enum KeySlot {
KEYMINT_SHARED_HMAC_KEY,
diff --git a/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl
index 44ec32f..97a4c37 100644
--- a/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl
@@ -35,10 +35,6 @@
* This is a key unique to the device.
*/
DEVICE_BOUND_KEY,
- /*
- * This is a shared by a set of devices.
- */
- BATCH_KEY,
}
/*
diff --git a/sensors/aidl/Android.bp b/sensors/aidl/Android.bp
index 8877e6e..63ace90 100644
--- a/sensors/aidl/Android.bp
+++ b/sensors/aidl/Android.bp
@@ -43,6 +43,6 @@
},
],
- frozen: true,
+ frozen: false,
}
diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/AdditionalInfo.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/AdditionalInfo.aidl
index 5184723..a35b54c 100644
--- a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/AdditionalInfo.aidl
+++ b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/AdditionalInfo.aidl
@@ -54,23 +54,23 @@
enum AdditionalInfoType {
AINFO_BEGIN = 0,
AINFO_END = 1,
- AINFO_UNTRACKED_DELAY = 65536,
- AINFO_INTERNAL_TEMPERATURE = 65537,
- AINFO_VEC3_CALIBRATION = 65538,
- AINFO_SENSOR_PLACEMENT = 65539,
- AINFO_SAMPLING = 65540,
- AINFO_CHANNEL_NOISE = 131072,
- AINFO_CHANNEL_SAMPLER = 131073,
- AINFO_CHANNEL_FILTER = 131074,
- AINFO_CHANNEL_LINEAR_TRANSFORM = 131075,
- AINFO_CHANNEL_NONLINEAR_MAP = 131076,
- AINFO_CHANNEL_RESAMPLER = 131077,
- AINFO_LOCAL_GEOMAGNETIC_FIELD = 196608,
- AINFO_LOCAL_GRAVITY = 196609,
- AINFO_DOCK_STATE = 196610,
- AINFO_HIGH_PERFORMANCE_MODE = 196611,
- AINFO_MAGNETIC_FIELD_CALIBRATION = 196612,
- AINFO_CUSTOM_START = 268435456,
- AINFO_DEBUGGING_START = 1073741824,
+ AINFO_UNTRACKED_DELAY = 0x10000,
+ AINFO_INTERNAL_TEMPERATURE,
+ AINFO_VEC3_CALIBRATION,
+ AINFO_SENSOR_PLACEMENT,
+ AINFO_SAMPLING,
+ AINFO_CHANNEL_NOISE = 0x20000,
+ AINFO_CHANNEL_SAMPLER,
+ AINFO_CHANNEL_FILTER,
+ AINFO_CHANNEL_LINEAR_TRANSFORM,
+ AINFO_CHANNEL_NONLINEAR_MAP,
+ AINFO_CHANNEL_RESAMPLER,
+ AINFO_LOCAL_GEOMAGNETIC_FIELD = 0x30000,
+ AINFO_LOCAL_GRAVITY,
+ AINFO_DOCK_STATE,
+ AINFO_HIGH_PERFORMANCE_MODE,
+ AINFO_MAGNETIC_FIELD_CALIBRATION,
+ AINFO_CUSTOM_START = 0x10000000,
+ AINFO_DEBUGGING_START = 0x40000000,
}
}
diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/ISensors.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/ISensors.aidl
index b26040b..0566a64 100644
--- a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/ISensors.aidl
+++ b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/ISensors.aidl
@@ -44,28 +44,28 @@
int registerDirectChannel(in android.hardware.sensors.ISensors.SharedMemInfo mem);
void setOperationMode(in android.hardware.sensors.ISensors.OperationMode mode);
void unregisterDirectChannel(in int channelHandle);
- const int ERROR_NO_MEMORY = -12;
- const int ERROR_BAD_VALUE = -22;
+ const int ERROR_NO_MEMORY = (-12) /* -12 */;
+ const int ERROR_BAD_VALUE = (-22) /* -22 */;
const int WAKE_LOCK_TIMEOUT_SECONDS = 1;
- const int EVENT_QUEUE_FLAG_BITS_READ_AND_PROCESS = 1;
- const int EVENT_QUEUE_FLAG_BITS_EVENTS_READ = 2;
- const int WAKE_LOCK_QUEUE_FLAG_BITS_DATA_WRITTEN = 1;
- const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_FIELD = 0;
- const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_REPORT_TOKEN = 4;
- const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_SENSOR_TYPE = 8;
- const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_ATOMIC_COUNTER = 12;
- const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_TIMESTAMP = 16;
- const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_DATA = 24;
- const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_RESERVED = 88;
+ const int EVENT_QUEUE_FLAG_BITS_READ_AND_PROCESS = (1 << 0) /* 1 */;
+ const int EVENT_QUEUE_FLAG_BITS_EVENTS_READ = (1 << 1) /* 2 */;
+ const int WAKE_LOCK_QUEUE_FLAG_BITS_DATA_WRITTEN = (1 << 0) /* 1 */;
+ const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_FIELD = 0x0;
+ const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_REPORT_TOKEN = 0x4;
+ const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_SENSOR_TYPE = 0x8;
+ const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_ATOMIC_COUNTER = 0xC;
+ const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_TIMESTAMP = 0x10;
+ const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_DATA = 0x18;
+ const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_RESERVED = 0x58;
const int DIRECT_REPORT_SENSOR_EVENT_TOTAL_LENGTH = 104;
- const int RUNTIME_SENSORS_HANDLE_BASE = 1593835520;
- const int RUNTIME_SENSORS_HANDLE_END = 1610612735;
+ const int RUNTIME_SENSORS_HANDLE_BASE = 0x5F000000;
+ const int RUNTIME_SENSORS_HANDLE_END = 0x5FFFFFFF;
@Backing(type="int") @VintfStability
enum RateLevel {
- STOP = 0,
- NORMAL = 1,
- FAST = 2,
- VERY_FAST = 3,
+ STOP,
+ NORMAL,
+ FAST,
+ VERY_FAST,
}
@Backing(type="int") @VintfStability
enum OperationMode {
@@ -85,7 +85,7 @@
@Backing(type="int") @VintfStability
enum SharedMemType {
ASHMEM = 1,
- GRALLOC = 2,
+ GRALLOC,
}
}
}
diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorInfo.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorInfo.aidl
index 996be3d..677e6c4 100644
--- a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorInfo.aidl
+++ b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorInfo.aidl
@@ -54,14 +54,14 @@
const int SENSOR_FLAG_BITS_ON_CHANGE_MODE = 2;
const int SENSOR_FLAG_BITS_ONE_SHOT_MODE = 4;
const int SENSOR_FLAG_BITS_SPECIAL_REPORTING_MODE = 6;
- const int SENSOR_FLAG_BITS_DATA_INJECTION = 16;
- const int SENSOR_FLAG_BITS_DYNAMIC_SENSOR = 32;
- const int SENSOR_FLAG_BITS_ADDITIONAL_INFO = 64;
- const int SENSOR_FLAG_BITS_DIRECT_CHANNEL_ASHMEM = 1024;
- const int SENSOR_FLAG_BITS_DIRECT_CHANNEL_GRALLOC = 2048;
- const int SENSOR_FLAG_BITS_MASK_REPORTING_MODE = 14;
- const int SENSOR_FLAG_BITS_MASK_DIRECT_REPORT = 896;
- const int SENSOR_FLAG_BITS_MASK_DIRECT_CHANNEL = 3072;
+ const int SENSOR_FLAG_BITS_DATA_INJECTION = 0x10;
+ const int SENSOR_FLAG_BITS_DYNAMIC_SENSOR = 0x20;
+ const int SENSOR_FLAG_BITS_ADDITIONAL_INFO = 0x40;
+ const int SENSOR_FLAG_BITS_DIRECT_CHANNEL_ASHMEM = 0x400;
+ const int SENSOR_FLAG_BITS_DIRECT_CHANNEL_GRALLOC = 0x800;
+ const int SENSOR_FLAG_BITS_MASK_REPORTING_MODE = 0xE;
+ const int SENSOR_FLAG_BITS_MASK_DIRECT_REPORT = 0x380;
+ const int SENSOR_FLAG_BITS_MASK_DIRECT_CHANNEL = 0xC00;
const int SENSOR_FLAG_SHIFT_REPORTING_MODE = 1;
const int SENSOR_FLAG_SHIFT_DATA_INJECTION = 4;
const int SENSOR_FLAG_SHIFT_DYNAMIC_SENSOR = 5;
diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorStatus.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorStatus.aidl
index 4521710..f401dac 100644
--- a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorStatus.aidl
+++ b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorStatus.aidl
@@ -34,7 +34,7 @@
package android.hardware.sensors;
@Backing(type="byte") @VintfStability
enum SensorStatus {
- NO_CONTACT = -1,
+ NO_CONTACT = (-1) /* -1 */,
UNRELIABLE = 0,
ACCURACY_LOW = 1,
ACCURACY_MEDIUM = 2,
diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorType.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorType.aidl
index 8c864e9..9332c63 100644
--- a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorType.aidl
+++ b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorType.aidl
@@ -76,5 +76,6 @@
ACCELEROMETER_LIMITED_AXES_UNCALIBRATED = 40,
GYROSCOPE_LIMITED_AXES_UNCALIBRATED = 41,
HEADING = 42,
- DEVICE_PRIVATE_BASE = 65536,
+ MOISTURE_INTRUSION = 43,
+ DEVICE_PRIVATE_BASE = 0x10000,
}
diff --git a/sensors/aidl/android/hardware/sensors/Event.aidl b/sensors/aidl/android/hardware/sensors/Event.aidl
index b95299c..7775cfc 100644
--- a/sensors/aidl/android/hardware/sensors/Event.aidl
+++ b/sensors/aidl/android/hardware/sensors/Event.aidl
@@ -88,7 +88,7 @@
* SensorType::GLANCE_GESTURE, SensorType::PICK_UP_GESTURE,
* SensorType::WRIST_TILT_GESTURE, SensorType::STATIONARY_DETECT,
* SensorType::MOTION_DETECT, SensorType::HEART_BEAT,
- * SensorType::LOW_LATENCY_OFFBODY_DETECT
+ * SensorType::LOW_LATENCY_OFFBODY_DETECT, SensorType::MOISTURE_INTRUSION
*/
float scalar;
diff --git a/sensors/aidl/android/hardware/sensors/SensorType.aidl b/sensors/aidl/android/hardware/sensors/SensorType.aidl
index 4904c3f..adaf8e6 100644
--- a/sensors/aidl/android/hardware/sensors/SensorType.aidl
+++ b/sensors/aidl/android/hardware/sensors/SensorType.aidl
@@ -718,6 +718,20 @@
HEADING = 42,
/**
+ * MOISTURE_INTRUSION
+ * trigger mode: on-change
+ *
+ * Detects moisture intrusion in the chassis of device. This detection is
+ * one-way and persistent. Once a device is detected to have water damage,
+ * it will always report 1 (across factory reset /reboot) even if moisture
+ * is no longer present, until the device has been repaired.
+ * The only allowed values to return are:
+ * 0.0: no moisture intrusion detected in relevant history
+ * 1.0: moisture intrusion detected now or previously
+ */
+ MOISTURE_INTRUSION = 43,
+
+ /**
* Base of the range reserved for device manufacturers' private sensor
* types. These sensor types aren't documented in the SDK.
*/
diff --git a/sensors/aidl/convert/Android.bp b/sensors/aidl/convert/Android.bp
index 7217b2f..548308e 100644
--- a/sensors/aidl/convert/Android.bp
+++ b/sensors/aidl/convert/Android.bp
@@ -36,7 +36,7 @@
"libhardware",
"libbase",
"libutils",
- "android.hardware.sensors-V2-ndk",
+ "android.hardware.sensors-V3-ndk",
],
whole_static_libs: [
"sensors_common_convert",
diff --git a/sensors/aidl/default/Android.bp b/sensors/aidl/default/Android.bp
index 6f011ee..4bdcfb0 100644
--- a/sensors/aidl/default/Android.bp
+++ b/sensors/aidl/default/Android.bp
@@ -32,7 +32,7 @@
"libfmq",
"libpower",
"libbinder_ndk",
- "android.hardware.sensors-V2-ndk",
+ "android.hardware.sensors-V3-ndk",
],
export_include_dirs: ["include"],
srcs: [
@@ -58,7 +58,7 @@
static_libs: [
"android.hardware.common-V2-ndk",
"android.hardware.common.fmq-V1-ndk",
- "android.hardware.sensors-V2-ndk",
+ "android.hardware.sensors-V3-ndk",
"android.system.suspend-V1-ndk",
"libbase",
"libcutils",
diff --git a/sensors/aidl/default/multihal/Android.bp b/sensors/aidl/default/multihal/Android.bp
index 7482ffe..6ca81d9 100644
--- a/sensors/aidl/default/multihal/Android.bp
+++ b/sensors/aidl/default/multihal/Android.bp
@@ -39,7 +39,7 @@
"android.hardware.sensors@1.0",
"android.hardware.sensors@2.0",
"android.hardware.sensors@2.1",
- "android.hardware.sensors-V2-ndk",
+ "android.hardware.sensors-V3-ndk",
],
export_include_dirs: ["include"],
srcs: [
diff --git a/sensors/aidl/default/sensors-default.xml b/sensors/aidl/default/sensors-default.xml
index 36b28ed..bed2538 100644
--- a/sensors/aidl/default/sensors-default.xml
+++ b/sensors/aidl/default/sensors-default.xml
@@ -1,7 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.sensors</name>
- <version>2</version>
+ <version>3</version>
<fqname>ISensors/default</fqname>
</hal>
</manifest>
diff --git a/sensors/aidl/multihal/Android.bp b/sensors/aidl/multihal/Android.bp
index cac5fc2..cee3db6 100644
--- a/sensors/aidl/multihal/Android.bp
+++ b/sensors/aidl/multihal/Android.bp
@@ -41,7 +41,7 @@
"android.hardware.sensors@2.0-ScopedWakelock",
"android.hardware.sensors@2.0",
"android.hardware.sensors@2.1",
- "android.hardware.sensors-V2-ndk",
+ "android.hardware.sensors-V3-ndk",
"libbase",
"libcutils",
"libfmq",
diff --git a/sensors/aidl/multihal/android.hardware.sensors-multihal.xml b/sensors/aidl/multihal/android.hardware.sensors-multihal.xml
index 5da4fbd..9186f64 100644
--- a/sensors/aidl/multihal/android.hardware.sensors-multihal.xml
+++ b/sensors/aidl/multihal/android.hardware.sensors-multihal.xml
@@ -17,7 +17,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.sensors</name>
- <version>2</version>
+ <version>3</version>
<fqname>ISensors/default</fqname>
</hal>
</manifest>
diff --git a/sensors/aidl/vts/Android.bp b/sensors/aidl/vts/Android.bp
index 1f96bb4..63371cd 100644
--- a/sensors/aidl/vts/Android.bp
+++ b/sensors/aidl/vts/Android.bp
@@ -42,7 +42,7 @@
"android.hardware.common.fmq-V1-ndk",
],
static_libs: [
- "android.hardware.sensors-V2-ndk",
+ "android.hardware.sensors-V3-ndk",
"VtsHalSensorsTargetTestUtils",
"libaidlcommonsupport",
],
diff --git a/thermal/OWNERS b/thermal/OWNERS
index 7229b22..13895bd 100644
--- a/thermal/OWNERS
+++ b/thermal/OWNERS
@@ -1,5 +1,3 @@
# Bug component: 826709
-
-# ADPF virtual team
-lpy@google.com
+file:platform/frameworks/base:/ADPF_OWNERS
wvw@google.com
diff --git a/thermal/aidl/default/Thermal.cpp b/thermal/aidl/default/Thermal.cpp
index 339e9b8..04efbd6 100644
--- a/thermal/aidl/default/Thermal.cpp
+++ b/thermal/aidl/default/Thermal.cpp
@@ -47,27 +47,85 @@
return ScopedAStatus::ok();
}
-ScopedAStatus Thermal::getTemperatures(std::vector<Temperature>* /* out_temperatures */) {
+ScopedAStatus Thermal::getTemperatures(std::vector<Temperature>* out_temperatures) {
LOG(VERBOSE) << __func__;
+ std::vector<Temperature> temperatures;
+ temperatures.push_back(Temperature{
+ .name = "skin",
+ .type = TemperatureType::SKIN,
+ .value = 30.1f,
+ });
+ temperatures.push_back(Temperature{
+ .name = "battery",
+ .type = TemperatureType::BATTERY,
+ .value = 30.2f,
+ });
+ *out_temperatures = temperatures;
return ScopedAStatus::ok();
}
ScopedAStatus Thermal::getTemperaturesWithType(TemperatureType in_type,
- std::vector<Temperature>* /* out_temperatures */) {
+ std::vector<Temperature>* out_temperatures) {
LOG(VERBOSE) << __func__ << " TemperatureType: " << static_cast<int32_t>(in_type);
+ if (in_type == TemperatureType::SKIN) {
+ std::vector<Temperature> temperatures;
+ temperatures.push_back(Temperature{
+ .name = "skin",
+ .type = TemperatureType::SKIN,
+ .value = 30.1f,
+ });
+ *out_temperatures = temperatures;
+ } else if (in_type == TemperatureType::BATTERY) {
+ std::vector<Temperature> temperatures;
+ temperatures.push_back(Temperature{
+ .name = "battery",
+ .type = TemperatureType::BATTERY,
+ .value = 30.2f,
+ });
+ *out_temperatures = temperatures;
+ }
return ScopedAStatus::ok();
}
ScopedAStatus Thermal::getTemperatureThresholds(
- std::vector<TemperatureThreshold>* /* out_temperatureThresholds */) {
+ std::vector<TemperatureThreshold>* out_temperatureThresholds) {
LOG(VERBOSE) << __func__;
+ std::vector<TemperatureThreshold> temperatureThresholds;
+ temperatureThresholds.push_back(TemperatureThreshold{
+ .name = "skin",
+ .type = TemperatureType::SKIN,
+ .hotThrottlingThresholds = {30.0f, 31.0f, 32.0f, 33.0f, 34.0f, 35.0f, 36.0f},
+ });
+ temperatureThresholds.push_back(TemperatureThreshold{
+ .name = "battery",
+ .type = TemperatureType::BATTERY,
+ .hotThrottlingThresholds = {30.0f, 31.0f, 32.0f, 33.0f, 34.0f, 35.0f, 36.0f},
+ });
+ *out_temperatureThresholds = temperatureThresholds;
return ScopedAStatus::ok();
}
ScopedAStatus Thermal::getTemperatureThresholdsWithType(
TemperatureType in_type,
- std::vector<TemperatureThreshold>* /* out_temperatureThresholds */) {
+ std::vector<TemperatureThreshold>* out_temperatureThresholds) {
LOG(VERBOSE) << __func__ << " TemperatureType: " << static_cast<int32_t>(in_type);
+ if (in_type == TemperatureType::SKIN) {
+ std::vector<TemperatureThreshold> temperatureThresholds;
+ temperatureThresholds.push_back(TemperatureThreshold{
+ .name = "skin",
+ .type = TemperatureType::SKIN,
+ .hotThrottlingThresholds = {30.0f, 31.0f, 32.0f, 33.0f, 34.0f, 35.0f, 36.0f},
+ });
+ *out_temperatureThresholds = temperatureThresholds;
+ } else if (in_type == TemperatureType::BATTERY) {
+ std::vector<TemperatureThreshold> temperatureThresholds;
+ temperatureThresholds.push_back(TemperatureThreshold{
+ .name = "battery",
+ .type = TemperatureType::BATTERY,
+ .hotThrottlingThresholds = {30.0f, 31.0f, 32.0f, 33.0f, 34.0f, 35.0f, 36.0f},
+ });
+ *out_temperatureThresholds = temperatureThresholds;
+ }
return ScopedAStatus::ok();
}
diff --git a/tv/input/aidl/Android.bp b/tv/input/aidl/Android.bp
index afc811a..8d36ab1 100644
--- a/tv/input/aidl/Android.bp
+++ b/tv/input/aidl/Android.bp
@@ -45,5 +45,5 @@
},
],
- frozen: true,
+ frozen: false,
}
diff --git a/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/ITvInput.aidl b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/ITvInput.aidl
index 84fe2fb..2ff2719 100644
--- a/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/ITvInput.aidl
+++ b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/ITvInput.aidl
@@ -40,6 +40,8 @@
void setCallback(in android.hardware.tv.input.ITvInputCallback callback);
void setTvMessageEnabled(int deviceId, int streamId, in android.hardware.tv.input.TvMessageEventType type, boolean enabled);
void getTvMessageQueueDesc(out android.hardware.common.fmq.MQDescriptor<byte,android.hardware.common.fmq.SynchronizedReadWrite> queue, int deviceId, int streamId);
+ void setPictureProfileId(in int deviceId, in int streamId, in long profileId);
+ void setSoundProfileId(in int deviceId, in int streamId, in long profileId);
const int STATUS_UNKNOWN = 1;
const int STATUS_NO_RESOURCE = 2;
const int STATUS_INVALID_ARGUMENTS = 3;
diff --git a/tv/input/aidl/android/hardware/tv/input/ITvInput.aidl b/tv/input/aidl/android/hardware/tv/input/ITvInput.aidl
index c63e0ac..e57edf9 100644
--- a/tv/input/aidl/android/hardware/tv/input/ITvInput.aidl
+++ b/tv/input/aidl/android/hardware/tv/input/ITvInput.aidl
@@ -109,4 +109,28 @@
*/
void getTvMessageQueueDesc(
out MQDescriptor<byte, SynchronizedReadWrite> queue, int deviceId, int streamId);
+
+ /**
+ * Set the picture profile ID for a specific stream in a device.
+ *
+ * @param deviceId Device ID for the stream to use the profile.
+ * @param streamId Stream ID for the stream to use the profile. Must be one of the
+ * stream IDs returned from getStreamConfigurations().
+ * @param profileId Picture profile ID for the stream. The ID is assigned by the framework,
+ * and can be set by applications or TV input framework. See
+ * android.media.quality.PictureQuality for more details.
+ */
+ void setPictureProfileId(in int deviceId, in int streamId, in long profileId);
+
+ /**
+ * Set the sound profile ID for a specific stream in a device.
+ *
+ * @param deviceId Device ID for the stream to use the profile.
+ * @param streamId Stream ID for the stream to use the profile. Must be one of the
+ * stream IDs returned from getStreamConfigurations().
+ * @param profileId Sound profile ID for the stream. The ID is assigned by the framework,
+ * and can be set by applications or TV input framework. See
+ * android.media.quality.SoundQuality for more details.
+ */
+ void setSoundProfileId(in int deviceId, in int streamId, in long profileId);
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ColorRange.aidl
similarity index 90%
copy from gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
copy to tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ColorRange.aidl
index ae709d4..c08c6cc 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ColorRange.aidl
@@ -31,14 +31,10 @@
// 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.gnss.gnss_assistance;
-/* @hide */
+package android.hardware.tv.mediaquality;
@VintfStability
-parcelable TimeOfClock {
- int year;
- int month;
- int day;
- int hour;
- int minute;
- int seconds;
+enum ColorRange {
+ AUTO,
+ LIMITED,
+ FULL,
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ColorSpace.aidl
similarity index 90%
copy from gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
copy to tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ColorSpace.aidl
index ae709d4..9bcddcb 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ColorSpace.aidl
@@ -31,14 +31,14 @@
// 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.gnss.gnss_assistance;
-/* @hide */
+package android.hardware.tv.mediaquality;
@VintfStability
-parcelable TimeOfClock {
- int year;
- int month;
- int day;
- int hour;
- int minute;
- int seconds;
+enum ColorSpace {
+ AUTO,
+ S_RGB_BT_709,
+ DCI,
+ ADOBE_RGB,
+ BT2020,
+ ON,
+ OFF,
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ColorTemperature.aidl
similarity index 88%
copy from gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
copy to tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ColorTemperature.aidl
index ae709d4..2d26aca 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ColorTemperature.aidl
@@ -31,14 +31,17 @@
// 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.gnss.gnss_assistance;
-/* @hide */
+package android.hardware.tv.mediaquality;
@VintfStability
-parcelable TimeOfClock {
- int year;
- int month;
- int day;
- int hour;
- int minute;
- int seconds;
+enum ColorTemperature {
+ USER,
+ COOL,
+ STANDARD,
+ WARM,
+ USER_HDR10PLUS,
+ COOL_HDR10PLUS,
+ STANDARD_HDR10PLUS,
+ WARM_HDR10PLUS,
+ FMMSDR,
+ FMMHDR,
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/Gamma.aidl
similarity index 90%
copy from gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
copy to tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/Gamma.aidl
index ae709d4..89bb808 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/Gamma.aidl
@@ -31,14 +31,10 @@
// 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.gnss.gnss_assistance;
-/* @hide */
+package android.hardware.tv.mediaquality;
@VintfStability
-parcelable TimeOfClock {
- int year;
- int month;
- int day;
- int hour;
- int minute;
- int seconds;
+enum Gamma {
+ DARK,
+ MIDDLE,
+ BRIGHT,
}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/IMediaQuality.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/IMediaQuality.aidl
index 7215464..b569baa 100644
--- a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/IMediaQuality.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/IMediaQuality.aidl
@@ -49,8 +49,12 @@
void setAutoAqEnabled(boolean enable);
android.hardware.tv.mediaquality.IPictureProfileChangedListener getPictureProfileListener();
void setPictureProfileAdjustmentListener(android.hardware.tv.mediaquality.IPictureProfileAdjustmentListener listener);
- android.hardware.tv.mediaquality.PictureParameters getPictureParameters(long pictureProfileId);
+ void sendDefaultPictureParameters(in android.hardware.tv.mediaquality.PictureParameters pictureParameters);
android.hardware.tv.mediaquality.ISoundProfileChangedListener getSoundProfileListener();
void setSoundProfileAdjustmentListener(android.hardware.tv.mediaquality.ISoundProfileAdjustmentListener listener);
- android.hardware.tv.mediaquality.SoundParameters getSoundParameters(long soundProfileId);
+ void sendDefaultSoundParameters(in android.hardware.tv.mediaquality.SoundParameters soundParameters);
+ void getParamCaps(in android.hardware.tv.mediaquality.ParameterName[] paramNames, out android.hardware.tv.mediaquality.ParamCapability[] caps);
+ void getVendorParamCaps(in android.hardware.tv.mediaquality.VendorParameterIdentifier[] names, out android.hardware.tv.mediaquality.VendorParamCapability[] caps);
+ void sendPictureParameters(in android.hardware.tv.mediaquality.PictureParameters pictureParameters);
+ void sendSoundParameters(in android.hardware.tv.mediaquality.SoundParameters soundParameters);
}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/IPictureProfileAdjustmentListener.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/IPictureProfileAdjustmentListener.aidl
index ae3d391..e1a882e 100644
--- a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/IPictureProfileAdjustmentListener.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/IPictureProfileAdjustmentListener.aidl
@@ -35,4 +35,7 @@
@VintfStability
interface IPictureProfileAdjustmentListener {
oneway void onPictureProfileAdjusted(in android.hardware.tv.mediaquality.PictureProfile pictureProfile);
+ oneway void onParamCapabilityChanged(long pictureProfileId, in android.hardware.tv.mediaquality.ParamCapability[] caps);
+ oneway void onVendorParamCapabilityChanged(long pictureProfileId, in android.hardware.tv.mediaquality.VendorParamCapability[] caps);
+ oneway void onRequestPictureParameters(long pictureProfileId);
}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ISoundProfileAdjustmentListener.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ISoundProfileAdjustmentListener.aidl
index ceebb1b..e162601 100644
--- a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ISoundProfileAdjustmentListener.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ISoundProfileAdjustmentListener.aidl
@@ -35,4 +35,7 @@
@VintfStability
interface ISoundProfileAdjustmentListener {
oneway void onSoundProfileAdjusted(in android.hardware.tv.mediaquality.SoundProfile soundProfile);
+ oneway void onParamCapabilityChanged(long soundProfileId, in android.hardware.tv.mediaquality.ParamCapability[] caps);
+ oneway void onVendorParamCapabilityChanged(long soundProfileId, in android.hardware.tv.mediaquality.VendorParamCapability[] caps);
+ oneway void onRequestSoundParameters(long SoundProfileId);
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/NumberRange.aidl
similarity index 85%
copy from gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
copy to tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/NumberRange.aidl
index ae709d4..9fc9d0d 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/NumberRange.aidl
@@ -31,14 +31,13 @@
// 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.gnss.gnss_assistance;
-/* @hide */
+package android.hardware.tv.mediaquality;
@VintfStability
-parcelable TimeOfClock {
- int year;
- int month;
- int day;
- int hour;
- int minute;
- int seconds;
+union NumberRange {
+ @nullable int[2] intMinMax;
+ @nullable long[2] longMinMax;
+ @nullable double[2] doubleMinMax;
+ @nullable int[] intValuesSupported;
+ @nullable long[] longValuesSupported;
+ @nullable double[] doubleValuesSupported;
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ParamCapability.aidl
similarity index 84%
copy from gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
copy to tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ParamCapability.aidl
index ae709d4..c60f1d1 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ParamCapability.aidl
@@ -31,14 +31,11 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.gnss.gnss_assistance;
-/* @hide */
+package android.hardware.tv.mediaquality;
@VintfStability
-parcelable TimeOfClock {
- int year;
- int month;
- int day;
- int hour;
- int minute;
- int seconds;
+parcelable ParamCapability {
+ android.hardware.tv.mediaquality.ParameterName name;
+ boolean isSupported;
+ @nullable android.hardware.tv.mediaquality.ParameterDefaultValue defaultValue;
+ @nullable android.hardware.tv.mediaquality.ParameterRange range;
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ParameterDefaultValue.aidl
similarity index 90%
copy from gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
copy to tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ParameterDefaultValue.aidl
index ae709d4..14e5ff4 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ParameterDefaultValue.aidl
@@ -31,14 +31,11 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.gnss.gnss_assistance;
-/* @hide */
+package android.hardware.tv.mediaquality;
@VintfStability
-parcelable TimeOfClock {
- int year;
- int month;
- int day;
- int hour;
- int minute;
- int seconds;
+union ParameterDefaultValue {
+ int intDefault;
+ long longDefault;
+ double doubleDefault;
+ String stringDefault;
}
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ValueRange.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ParameterName.aidl
similarity index 64%
copy from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ValueRange.aidl
copy to tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ParameterName.aidl
index 077652b..711e270 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ValueRange.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ParameterName.aidl
@@ -31,10 +31,50 @@
// 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.automotive.vehicle;
-@JavaDerive(equals=true, toString=true) @RustDerive(Clone=true) @VintfStability
-parcelable ValueRange {
- @nullable android.hardware.automotive.vehicle.RawPropValues minValue;
- @nullable android.hardware.automotive.vehicle.RawPropValues maxValue;
- @nullable List<android.hardware.automotive.vehicle.RawPropValues> supportedValues;
+package android.hardware.tv.mediaquality;
+@VintfStability
+enum ParameterName {
+ BRIGHTNESS,
+ CONTRAST,
+ SHARPNESS,
+ SATURATION,
+ HUE,
+ COLOR_TUNER_BRIGHTNESS,
+ COLOR_TUNER_SATURATION,
+ COLOR_TUNER_HUE,
+ COLOR_TUNER_RED_OFFSET,
+ COLOR_TUNER_GREEN_OFFSET,
+ COLOR_TUNER_BLUE_OFFSET,
+ COLOR_TUNER_RED_GAIN,
+ COLOR_TUNER_GREEN_GAIN,
+ COLOR_TUNER_BLUE_GAIN,
+ NOISE_REDUCTION,
+ MPEG_NOISE_REDUCTION,
+ FLASH_TONE,
+ DE_CONTOUR,
+ DYNAMIC_LUMA_CONTROL,
+ FILM_MODE,
+ BLACK_STRETCH,
+ BLUE_STRETCH,
+ COLOR_TUNE,
+ COLOR_TEMPERATURE,
+ GLOBE_DIMMING,
+ AUTO_PICTUREQUALITY_ENABLED,
+ AUTO_SUPER_RESOLUTION_ENABLED,
+ BALANCE,
+ BASS,
+ TREBLE,
+ SURROUND_SOUND_ENABLED,
+ EQUALIZER_DETAIL,
+ SPEAKERS_ENABLED,
+ SPEAKERS_DELAY_MS,
+ ENHANCED_AUDIO_RETURN_CHANNEL_ENABLED,
+ AUTO_VOLUME_CONTROL,
+ DOWNMIX_MODE,
+ DTS_DRC,
+ DOLBY_AUDIO_PROCESSING,
+ DOLBY_DIALOGUE_ENHANCER,
+ DTS_VIRTUAL_X,
+ DIGITAL_OUTPUT,
+ DIGITAL_OUTPUT_DELAY_MS,
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ParameterRange.aidl
similarity index 90%
copy from gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
copy to tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ParameterRange.aidl
index ae709d4..66bc405 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ParameterRange.aidl
@@ -31,14 +31,9 @@
// 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.gnss.gnss_assistance;
-/* @hide */
+package android.hardware.tv.mediaquality;
@VintfStability
-parcelable TimeOfClock {
- int year;
- int month;
- int day;
- int hour;
- int minute;
- int seconds;
+parcelable ParameterRange {
+ android.hardware.tv.mediaquality.NumberRange numRange;
+ ParcelableHolder vendorDefinedValues;
}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/PictureParameter.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/PictureParameter.aidl
index 134997b..c38e96f 100644
--- a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/PictureParameter.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/PictureParameter.aidl
@@ -39,4 +39,36 @@
int sharpness;
int saturation;
int hue;
+ int colorTunerBrightness;
+ int colorTunerSaturation;
+ int colorTunerHue;
+ int colorTunerRedOffset;
+ int colorTunerGreenOffset;
+ int colorTunerBlueOffset;
+ int colorTunerRedGain;
+ int colorTunerGreenGain;
+ int colorTunerBlueGain;
+ android.hardware.tv.mediaquality.QualityLevel noiseReduction;
+ android.hardware.tv.mediaquality.QualityLevel mpegNoiseReduction;
+ android.hardware.tv.mediaquality.QualityLevel fleshTone;
+ android.hardware.tv.mediaquality.QualityLevel deContour;
+ android.hardware.tv.mediaquality.QualityLevel dynamicLumaControl;
+ boolean filmMode;
+ boolean blueStretch;
+ boolean colorTune;
+ android.hardware.tv.mediaquality.ColorTemperature colorTemperature;
+ boolean globeDimming;
+ boolean autoPictureQualityEnabled;
+ boolean autoSuperResolutionEnabled;
+ android.hardware.tv.mediaquality.ColorRange levelRange;
+ boolean gamutMapping;
+ boolean pcMode;
+ boolean lowLatency;
+ boolean vrr;
+ boolean cvrr;
+ android.hardware.tv.mediaquality.ColorRange hdmiRgbRange;
+ android.hardware.tv.mediaquality.ColorSpace colorSpace;
+ int panelInitMaxLuminceNits;
+ boolean panelInitMaxLuminceValid;
+ android.hardware.tv.mediaquality.Gamma gamma;
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/VendorParamCapability.aidl
similarity index 83%
copy from gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
copy to tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/VendorParamCapability.aidl
index ae709d4..5f16de9 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/VendorParamCapability.aidl
@@ -31,14 +31,11 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.gnss.gnss_assistance;
-/* @hide */
+package android.hardware.tv.mediaquality;
@VintfStability
-parcelable TimeOfClock {
- int year;
- int month;
- int day;
- int hour;
- int minute;
- int seconds;
+parcelable VendorParamCapability {
+ android.hardware.tv.mediaquality.VendorParameterIdentifier identifier;
+ boolean isSupported;
+ @nullable android.hardware.tv.mediaquality.ParameterDefaultValue defaultValue;
+ @nullable android.hardware.tv.mediaquality.ParameterRange range;
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/VendorParameterIdentifier.aidl
similarity index 90%
copy from gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
copy to tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/VendorParameterIdentifier.aidl
index ae709d4..016c22d 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/VendorParameterIdentifier.aidl
@@ -31,14 +31,8 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.gnss.gnss_assistance;
-/* @hide */
+package android.hardware.tv.mediaquality;
@VintfStability
-parcelable TimeOfClock {
- int year;
- int month;
- int day;
- int hour;
- int minute;
- int seconds;
+parcelable VendorParameterIdentifier {
+ ParcelableHolder identifier;
}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ColorRange.aidl
similarity index 60%
copy from gnss/aidl/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
copy to tv/mediaquality/aidl/android/hardware/tv/mediaquality/ColorRange.aidl
index 7b9cc9f..29f12ef 100644
--- a/gnss/aidl/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ColorRange.aidl
@@ -14,30 +14,14 @@
* limitations under the License.
*/
-package android.hardware.gnss.gnss_assistance;
+package android.hardware.tv.mediaquality;
-/*
- * Contains the reference time of the GNSS clock.
- *
- * @hide
+/**
+ * The range of color the TV can display.
*/
@VintfStability
-parcelable TimeOfClock {
- /** Year of the clock. */
- int year;
-
- /** Month of the clock. */
- int month;
-
- /** Day of the clock. */
- int day;
-
- /** Hour of the clock. */
- int hour;
-
- /** Minute of the clock. */
- int minute;
-
- /** Second of the clock. */
- int seconds;
+enum ColorRange {
+ AUTO,
+ LIMITED,
+ FULL,
}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ColorSpace.aidl
similarity index 60%
copy from gnss/aidl/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
copy to tv/mediaquality/aidl/android/hardware/tv/mediaquality/ColorSpace.aidl
index 7b9cc9f..bd4511d 100644
--- a/gnss/aidl/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ColorSpace.aidl
@@ -14,30 +14,18 @@
* limitations under the License.
*/
-package android.hardware.gnss.gnss_assistance;
+package android.hardware.tv.mediaquality;
-/*
- * Contains the reference time of the GNSS clock.
- *
- * @hide
+/**
+ * Specific model used to define and represent colors numerically.
*/
@VintfStability
-parcelable TimeOfClock {
- /** Year of the clock. */
- int year;
-
- /** Month of the clock. */
- int month;
-
- /** Day of the clock. */
- int day;
-
- /** Hour of the clock. */
- int hour;
-
- /** Minute of the clock. */
- int minute;
-
- /** Second of the clock. */
- int seconds;
+enum ColorSpace {
+ AUTO,
+ S_RGB_BT_709,
+ DCI,
+ ADOBE_RGB,
+ BT2020,
+ ON,
+ OFF,
}
diff --git a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ColorTemperature.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ColorTemperature.aidl
new file mode 100644
index 0000000..4d4b01c
--- /dev/null
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ColorTemperature.aidl
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2024 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.tv.mediaquality;
+
+@VintfStability
+enum ColorTemperature {
+ USER,
+ COOL,
+ STANDARD,
+ WARM,
+ USER_HDR10PLUS,
+ COOL_HDR10PLUS,
+ STANDARD_HDR10PLUS,
+ WARM_HDR10PLUS,
+ FMMSDR,
+ FMMHDR,
+}
diff --git a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/Gamma.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/Gamma.aidl
new file mode 100644
index 0000000..c633557
--- /dev/null
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/Gamma.aidl
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2024 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.tv.mediaquality;
+
+@VintfStability
+enum Gamma {
+ DARK,
+ MIDDLE,
+ BRIGHT,
+}
diff --git a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/IMediaQuality.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/IMediaQuality.aidl
index f15d3c6..373a977 100644
--- a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/IMediaQuality.aidl
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/IMediaQuality.aidl
@@ -22,8 +22,12 @@
import android.hardware.tv.mediaquality.IPictureProfileChangedListener;
import android.hardware.tv.mediaquality.ISoundProfileAdjustmentListener;
import android.hardware.tv.mediaquality.ISoundProfileChangedListener;
+import android.hardware.tv.mediaquality.ParamCapability;
+import android.hardware.tv.mediaquality.ParameterName;
import android.hardware.tv.mediaquality.PictureParameters;
import android.hardware.tv.mediaquality.SoundParameters;
+import android.hardware.tv.mediaquality.VendorParamCapability;
+import android.hardware.tv.mediaquality.VendorParameterIdentifier;
/**
* Interface for the media quality service
@@ -145,17 +149,25 @@
/**
* Sets the listener for picture adjustment from the HAL.
*
- * @param IPictureProfileAdjustmentListener listener object to pass picture profile.
+ * When the same client registers this listener multiple times, only the most recent
+ * registration will be active. The previous listener will be overwritten.
+ *
+ * When different client registers this listener, it will overwrite the previous registered
+ * client. Only one listener can be active.
+ *
+ * @param IPictureProfileAdjustmentListener listener object to pass picture profile, profile
+ * id and hardware capability.
*/
void setPictureProfileAdjustmentListener(IPictureProfileAdjustmentListener listener);
/**
- * Get the picture parameters by PictureProfile id. Check PictureParameters for its' detail.
+ * Send the default picture parameters to the vendor code or HAL to apply the picture
+ * parameters.
*
- * @param pictureProfileId The PictureProfile id that associate with the PictureProfile.
- * @return PictureParameters with all the pre-defined parameters and vendor defined parameters.
+ * @param pictureParameters PictureParameters with pre-defined parameters and vendor defined
+ * parameters.
*/
- PictureParameters getPictureParameters(long pictureProfileId);
+ void sendDefaultPictureParameters(in PictureParameters pictureParameters);
/**
* Get sound profile changed listener.
@@ -167,15 +179,48 @@
/**
* Sets the listener for sound adjustment from the HAL.
*
- * @param ISoundProfileAdjustmentListener listener object to pass sound profile.
+ * When the same client registers this listener multiple times, only the most recent
+ * registration will be active. The previous listener will be overwritten.
+ *
+ * When different client registers this listener, it will overwrite the previous registered
+ * client. Only one listener can be active.
+ *
+ * @param ISoundProfileAdjustmentListener listener object to pass sound profile, profile id
+ * and hardware capability.
*/
void setSoundProfileAdjustmentListener(ISoundProfileAdjustmentListener listener);
/**
- * Get the sound parameters by SoundProfile id. Check SoundParameters for its' detail.
+ * Send the default sound parameters to the vendor code or HAL to apply the sound parameters.
*
- * @param soundProfileId The SoundProfile id that associate with a SoundProfile.
- * @return SoundParameters with all the pre-defined parameters and vendor defined parameters.
+ * @param soundParameters SoundParameters with pre-defined parameters and vendor defined
+ * parameters.
*/
- SoundParameters getSoundParameters(long soundProfileId);
+ void sendDefaultSoundParameters(in SoundParameters soundParameters);
+
+ /**
+ * Gets capability information of the given parameters.
+ */
+ void getParamCaps(in ParameterName[] paramNames, out ParamCapability[] caps);
+
+ /**
+ * Gets vendor capability information of the given parameters.
+ */
+ void getVendorParamCaps(in VendorParameterIdentifier[] names, out VendorParamCapability[] caps);
+
+ /**
+ * When HAL request picture parameters by picture profile id, the framework will use this to
+ * send the picture parameters associate with the profile id.
+ *
+ * @param pictureParameters pictureParameters that associate with the profile id HAL provided.
+ */
+ void sendPictureParameters(in PictureParameters pictureParameters);
+
+ /**
+ * When HAL request sound parameters by sound profile id, the framework will use this to
+ * send the sound parameters associate with the profile id.
+ *
+ * @param soundParameters soundParameters that associate with the profile id HAL provided.
+ */
+ void sendSoundParameters(in SoundParameters soundParameters);
}
diff --git a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/IPictureProfileAdjustmentListener.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/IPictureProfileAdjustmentListener.aidl
index 52759f7..06651e4 100644
--- a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/IPictureProfileAdjustmentListener.aidl
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/IPictureProfileAdjustmentListener.aidl
@@ -16,7 +16,9 @@
package android.hardware.tv.mediaquality;
+import android.hardware.tv.mediaquality.ParamCapability;
import android.hardware.tv.mediaquality.PictureProfile;
+import android.hardware.tv.mediaquality.VendorParamCapability;
@VintfStability
oneway interface IPictureProfileAdjustmentListener {
@@ -26,4 +28,36 @@
* @param pictureProfile Picture profile.
*/
void onPictureProfileAdjusted(in PictureProfile pictureProfile);
+
+ /**
+ * Notifies Media Quality Manager when parameter capabilities changed.
+ *
+ * @param pictureProfileId the ID of the profile used by the media content. -1 if there
+ * is no associated profile.
+ * @param caps the updated capabilities.
+ */
+ void onParamCapabilityChanged(long pictureProfileId, in ParamCapability[] caps);
+
+ /**
+ * Notifies Media Quality Manager when vendor parameter capabilities changed.
+ *
+ * <p>This should be also called when the listener is registered to let the client know
+ * what vendor parameters are supported.
+ *
+ * @param pictureProfileId the ID of the profile used by the media content. -1 if there
+ * is no associated profile.
+ * @param caps the updated vendor capabilities.
+ */
+ void onVendorParamCapabilityChanged(long pictureProfileId, in VendorParamCapability[] caps);
+
+ /**
+ * Request the picture parameters by picture profile id. Check PictureParameters for its detail.
+ * This is called from the HAL to media quality framework.
+ *
+ * The requested picture parameters will get from IMediaQuality::sendPictureParameters called
+ * by the framework.
+ *
+ * @param pictureProfileId The PictureProfile id that associate with the PictureProfile.
+ */
+ void onRequestPictureParameters(long pictureProfileId);
}
diff --git a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ISoundProfileAdjustmentListener.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ISoundProfileAdjustmentListener.aidl
index fd41352..2ab9c6c 100644
--- a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ISoundProfileAdjustmentListener.aidl
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ISoundProfileAdjustmentListener.aidl
@@ -16,7 +16,9 @@
package android.hardware.tv.mediaquality;
+import android.hardware.tv.mediaquality.ParamCapability;
import android.hardware.tv.mediaquality.SoundProfile;
+import android.hardware.tv.mediaquality.VendorParamCapability;
@VintfStability
oneway interface ISoundProfileAdjustmentListener {
@@ -26,4 +28,36 @@
* @param soundProfile Sound profile.
*/
void onSoundProfileAdjusted(in SoundProfile soundProfile);
+
+ /**
+ * Notifies Media Quality Manager when parameter capabilities changed.
+ *
+ * @param soundProfileId the ID of the profile used by the media content. -1 if there
+ * is no associated profile.
+ * @param caps the updated capabilities.
+ */
+ void onParamCapabilityChanged(long soundProfileId, in ParamCapability[] caps);
+
+ /**
+ * Notifies Media Quality Manager when vendor parameter capabilities changed.
+ *
+ * <p>This should be also called when the listener is registered to let the client know
+ * what vendor parameters are supported.
+ *
+ * @param soundProfileId the ID of the profile used by the media content. -1 if there
+ * is no associated profile.
+ * @param caps the updated vendor capabilities.
+ */
+ void onVendorParamCapabilityChanged(long soundProfileId, in VendorParamCapability[] caps);
+
+ /**
+ * Request the sound parameters by sound profile id. Check SoundParameters for its detail.
+ * This is called from the HAL to media quality framework.
+ *
+ * The requested sound parameters will get from IMediaQuality::sendSoundParameters called
+ * by the framework.
+ *
+ * @param SoundProfileId The SoundProfile id that associate with the SoundProfile.
+ */
+ void onRequestSoundParameters(long SoundProfileId);
}
diff --git a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/NumberRange.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/NumberRange.aidl
new file mode 100644
index 0000000..94a041c
--- /dev/null
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/NumberRange.aidl
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2024 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.tv.mediaquality;
+
+/** Parameter supported number range **/
+@VintfStability
+union NumberRange {
+ /** Min value and max value of an int parameter. Inclusive. */
+ @nullable int[2] intMinMax;
+ /** Min value and max value of a long parameter. Inclusive. */
+ @nullable long[2] longMinMax;
+ /** Min value and max value of a double parameter. Inclusive. */
+ @nullable double[2] doubleMinMax;
+
+ /** An array of supported int values. */
+ @nullable int[] intValuesSupported;
+ /** An array of supported long values. */
+ @nullable long[] longValuesSupported;
+ /** An array of supported double values. */
+ @nullable double[] doubleValuesSupported;
+}
diff --git a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ParamCapability.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ParamCapability.aidl
new file mode 100644
index 0000000..933a1a3
--- /dev/null
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ParamCapability.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2024 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.tv.mediaquality;
+
+import android.hardware.tv.mediaquality.ParameterDefaultValue;
+import android.hardware.tv.mediaquality.ParameterName;
+import android.hardware.tv.mediaquality.ParameterRange;
+/**
+ * Capability of parameters.
+ */
+@VintfStability
+parcelable ParamCapability {
+ /** Name of the parameter **/
+ ParameterName name;
+
+ /** true if this parameter is supported **/
+ boolean isSupported;
+
+ /**
+ * Default value of this parameter. null if there is no default value.
+ */
+ @nullable ParameterDefaultValue defaultValue;
+
+ /**
+ * The supported range of this parameter. null if there is no specific range.
+ */
+ @nullable ParameterRange range;
+}
diff --git a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ParameterDefaultValue.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ParameterDefaultValue.aidl
new file mode 100644
index 0000000..3827134
--- /dev/null
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ParameterDefaultValue.aidl
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2024 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.tv.mediaquality;
+
+/** Parameter default value **/
+@VintfStability
+union ParameterDefaultValue {
+ int intDefault;
+ long longDefault;
+ double doubleDefault;
+ String stringDefault;
+}
diff --git a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ParameterName.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ParameterName.aidl
new file mode 100644
index 0000000..0a3c97b
--- /dev/null
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ParameterName.aidl
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2024 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.tv.mediaquality;
+
+/**
+ * Parameter names.
+ * <p>Details of the parameters can be found at
+ * android.hardware.tv.mediaquality.PictureParameter and
+ * android.hardware.tv.mediaquality.SoundParameter.
+ */
+@VintfStability
+enum ParameterName {
+ BRIGHTNESS,
+ CONTRAST,
+ SHARPNESS,
+ SATURATION,
+ HUE,
+ COLOR_TUNER_BRIGHTNESS,
+ COLOR_TUNER_SATURATION,
+ COLOR_TUNER_HUE,
+ COLOR_TUNER_RED_OFFSET,
+ COLOR_TUNER_GREEN_OFFSET,
+ COLOR_TUNER_BLUE_OFFSET,
+ COLOR_TUNER_RED_GAIN,
+ COLOR_TUNER_GREEN_GAIN,
+ COLOR_TUNER_BLUE_GAIN,
+ NOISE_REDUCTION,
+ MPEG_NOISE_REDUCTION,
+ FLASH_TONE,
+ DE_CONTOUR,
+ DYNAMIC_LUMA_CONTROL,
+ FILM_MODE,
+ BLACK_STRETCH,
+ BLUE_STRETCH,
+ COLOR_TUNE,
+ COLOR_TEMPERATURE,
+ GLOBE_DIMMING,
+ AUTO_PICTUREQUALITY_ENABLED,
+ AUTO_SUPER_RESOLUTION_ENABLED,
+
+ BALANCE,
+ BASS,
+ TREBLE,
+ SURROUND_SOUND_ENABLED,
+ EQUALIZER_DETAIL,
+ SPEAKERS_ENABLED,
+ SPEAKERS_DELAY_MS,
+ ENHANCED_AUDIO_RETURN_CHANNEL_ENABLED,
+ AUTO_VOLUME_CONTROL,
+ DOWNMIX_MODE,
+ DTS_DRC,
+ DOLBY_AUDIO_PROCESSING,
+ DOLBY_DIALOGUE_ENHANCER,
+ DTS_VIRTUAL_X,
+ DIGITAL_OUTPUT,
+ DIGITAL_OUTPUT_DELAY_MS,
+}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ParameterRange.aidl
similarity index 60%
copy from gnss/aidl/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
copy to tv/mediaquality/aidl/android/hardware/tv/mediaquality/ParameterRange.aidl
index 7b9cc9f..836b5b8 100644
--- a/gnss/aidl/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ParameterRange.aidl
@@ -14,30 +14,16 @@
* limitations under the License.
*/
-package android.hardware.gnss.gnss_assistance;
+package android.hardware.tv.mediaquality;
-/*
- * Contains the reference time of the GNSS clock.
- *
- * @hide
- */
+import android.hardware.tv.mediaquality.NumberRange;
+
+/** Parameter supported range **/
@VintfStability
-parcelable TimeOfClock {
- /** Year of the clock. */
- int year;
+parcelable ParameterRange {
+ /** Supported number range */
+ NumberRange numRange;
- /** Month of the clock. */
- int month;
-
- /** Day of the clock. */
- int day;
-
- /** Hour of the clock. */
- int hour;
-
- /** Minute of the clock. */
- int minute;
-
- /** Second of the clock. */
- int seconds;
+ /** Supported vendor-defined values **/
+ ParcelableHolder vendorDefinedValues;
}
diff --git a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/PictureParameter.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/PictureParameter.aidl
index 342b593..b7f2a11 100644
--- a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/PictureParameter.aidl
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/PictureParameter.aidl
@@ -16,6 +16,12 @@
package android.hardware.tv.mediaquality;
+import android.hardware.tv.mediaquality.ColorRange;
+import android.hardware.tv.mediaquality.ColorSpace;
+import android.hardware.tv.mediaquality.ColorTemperature;
+import android.hardware.tv.mediaquality.Gamma;
+import android.hardware.tv.mediaquality.QualityLevel;
+
/**
* The parameters for Picture Profile.
*/
@@ -62,4 +68,189 @@
* The default/unmodified value for hue is 0.
*/
int hue;
+
+ /*
+ * Adjust brightness in advance color engine. Similar to a "brightness" control on a TV
+ * but acts at a lower level.
+ *
+ * The range is from 0 to 100, where 0 represents the minimum brightness and 100 represents
+ * the maximum brightness. The default/unmodified value is 50.
+ */
+ int colorTunerBrightness;
+
+ /*
+ * Adjust saturation in advance color engine. Similar to a "saturation" control on a TV
+ * but acts at a lower level.
+ *
+ * The range is from 0 to 100, where 0 being completely desaturated/grayscale and 100 being
+ * the most saturated. The default/unmodified value is 50.
+ */
+ int colorTunerSaturation;
+
+ /*
+ * Adjust hue in advance color engine. Similar to a "hue" control on a TV but acts at a lower
+ * level.
+ *
+ * The range is from -50 to 50, where -50 represents cooler setting for a specific color and 50
+ * represents warmer setting for a specific color. The default/unmodified value is 0.
+ */
+ int colorTunerHue;
+
+ /*
+ * Advance setting for red offset. Adjust the black level of red color channels, it control
+ * the minimum intensity of each color, affecting the shadows and dark areas of the image.
+ *
+ * The range is from 0 to 100, where 0 makes shadows darker and 100 makes shadows brighter.
+ * The default/unmodified value is 50.
+ */
+ int colorTunerRedOffset;
+
+ /*
+ * Advance setting for green offset. Adjust the black level of green color channels, it control
+ * the minimum intensity of each color, affecting the shadows and dark areas of the image.
+ *
+ * The range is from 0 to 100, where 0 makes shadows darker and 100 makes shadows brighter.
+ * The default/unmodified value is 50.
+ */
+ int colorTunerGreenOffset;
+
+ /*
+ * Advance setting for blue offset. Adjust the black level of blue color channels, it control
+ * the minimum intensity of each color, affecting the shadows and dark areas of the image.
+ *
+ * The range is from 0 to 100, where 0 makes shadows darker and 100 makes shadows brighter.
+ * The default/unmodified value is 50.
+ */
+ int colorTunerBlueOffset;
+
+ /*
+ * Advance setting for red gain. Adjust the gain or amplification of the red color channels.
+ * They control the overall intensity and white balance of red.
+ *
+ * The range is from 0 to 100, where 0 makes the red dimmer and 100 makes the red brighter.
+ * The default/unmodified value is 50.
+ */
+ int colorTunerRedGain;
+
+ /*
+ * Advance setting for green gain. Adjust the gain or amplification of the green color channels.
+ * They control the overall intensity and white balance of green.
+ *
+ * The range is from 0 to 100, where 0 makes the green dimmer and 100 makes the green brighter.
+ * The default/unmodified value is 50.
+ */
+ int colorTunerGreenGain;
+
+ /*
+ * Advance setting for blue gain. Adjust the gain or amplification of the blue color channels.
+ * They control the overall intensity and white balance of blue.
+ *
+ * The range is from 0 to 100, where 0 makes the blue dimmer and 100 makes the blue brighter.
+ * The default/unmodified value is 50.
+ */
+ int colorTunerBlueGain;
+
+ /* Noise reduction. (Off, Low, Medium, High) */
+ QualityLevel noiseReduction;
+
+ /* MPEG (moving picture experts group) noise reduction (Off, Low, Medium, High) */
+ QualityLevel mpegNoiseReduction;
+
+ /*
+ * Refine the flesh colors in the pictures without affecting the other colors on the screen.
+ * (Off, Low, Medium, High)
+ */
+ QualityLevel fleshTone;
+
+ /* Contour noise reduction. (Off, Low, Medium, High) */
+ QualityLevel deContour;
+
+ /* Dynamically change picture luma to enhance contrast. (Off, Low, Medium, High) */
+ QualityLevel dynamicLumaControl;
+
+ /* Enable/disable film mode */
+ boolean filmMode;
+
+ /* Enable/disable blue color auto stretch */
+ boolean blueStretch;
+
+ /* Enable/disable the overall color tuning feature. */
+ boolean colorTune;
+
+ /* Adjust color temperature type */
+ ColorTemperature colorTemperature;
+
+ /* Enable/disable globe dimming. */
+ boolean globeDimming;
+
+ /* Enable/disable auto adjust picture parameter based on the TV content. */
+ boolean autoPictureQualityEnabled;
+
+ /*
+ * Enable/disable auto upscaling the picture quality. It analyzes the lower-resolution
+ * image and uses its knowledge to invent the missing pixel, make the image look sharper.
+ */
+ boolean autoSuperResolutionEnabled;
+
+ /**
+ * The color range of the content. This indicates the range of luminance values
+ * used in the video signal.
+ */
+ ColorRange levelRange;
+
+ /**
+ * Enable/disable gamut mapping. Gamut mapping is a process that adjusts
+ * the colors in the video signal to match the color gamut of the display.
+ */
+ boolean gamutMapping;
+
+ /**
+ * Enable/disable PC mode. PC mode is a display mode that is optimized for
+ * use with computers.
+ */
+ boolean pcMode;
+
+ /**
+ * Enable/disable low latency mode. Low latency mode reduces the delay
+ * between the video source and the display.
+ */
+ boolean lowLatency;
+
+ /**
+ * Enable/disable variable refresh rate (VRR) mode. VRR allows the display to
+ * dynamically adjust its refresh rate to match the frame rate of the video
+ * source, reducing screen tearing.
+ */
+ boolean vrr;
+
+ /**
+ * Enable/disable continuous variable refresh rate (CVRR) mode. CVRR is a type
+ * of VRR that allows for a wider range of refresh rates.
+ */
+ boolean cvrr;
+
+ /**
+ * The color range of the HDMI input. This indicates the range of luminance
+ * values used in the HDMI signal.
+ */
+ ColorRange hdmiRgbRange;
+
+ /**
+ * The color space of the content. This indicates the color gamut and
+ * transfer function used in the video signal.
+ */
+ ColorSpace colorSpace;
+
+ /**
+ * The initial maximum luminance of the panel, in nits.
+ */
+ int panelInitMaxLuminceNits;
+
+ /**
+ * Whether the initial maximum luminance value is valid.
+ */
+ boolean panelInitMaxLuminceValid;
+
+ /* The gamma curve used for the display. */
+ Gamma gamma;
}
diff --git a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/VendorParamCapability.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/VendorParamCapability.aidl
new file mode 100644
index 0000000..bdc0188
--- /dev/null
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/VendorParamCapability.aidl
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2024 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.tv.mediaquality;
+
+import android.hardware.tv.mediaquality.ParameterDefaultValue;
+import android.hardware.tv.mediaquality.ParameterRange;
+import android.hardware.tv.mediaquality.VendorParameterIdentifier;
+
+/**
+ * Capability of vendor parameters.
+ */
+@VintfStability
+parcelable VendorParamCapability {
+ /** Identifier of the parameter **/
+ VendorParameterIdentifier identifier;
+
+ /** true if this parameter is supported **/
+ boolean isSupported;
+
+ /**
+ * Default value of this parameter. null if there is no default value.
+ */
+ @nullable ParameterDefaultValue defaultValue;
+
+ /**
+ * The supported range of this parameter. null if there is no specific range.
+ */
+ @nullable ParameterRange range;
+}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/VendorParameterIdentifier.aidl
similarity index 60%
copy from gnss/aidl/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
copy to tv/mediaquality/aidl/android/hardware/tv/mediaquality/VendorParameterIdentifier.aidl
index 7b9cc9f..f974b16 100644
--- a/gnss/aidl/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/VendorParameterIdentifier.aidl
@@ -14,30 +14,13 @@
* limitations under the License.
*/
-package android.hardware.gnss.gnss_assistance;
+package android.hardware.tv.mediaquality;
-/*
- * Contains the reference time of the GNSS clock.
- *
- * @hide
+/**
+ * Identifier of vendor parameters.
*/
@VintfStability
-parcelable TimeOfClock {
- /** Year of the clock. */
- int year;
-
- /** Month of the clock. */
- int month;
-
- /** Day of the clock. */
- int day;
-
- /** Hour of the clock. */
- int hour;
-
- /** Minute of the clock. */
- int minute;
-
- /** Second of the clock. */
- int seconds;
+parcelable VendorParameterIdentifier {
+ /** Identifier of the parameter **/
+ ParcelableHolder identifier;
}
diff --git a/tv/mediaquality/aidl/default/hal/media_quality_hal_impl.rs b/tv/mediaquality/aidl/default/hal/media_quality_hal_impl.rs
index a579e66..1946cec 100644
--- a/tv/mediaquality/aidl/default/hal/media_quality_hal_impl.rs
+++ b/tv/mediaquality/aidl/default/hal/media_quality_hal_impl.rs
@@ -22,14 +22,16 @@
AmbientBacklightSettings::AmbientBacklightSettings,
IPictureProfileAdjustmentListener::IPictureProfileAdjustmentListener,
IPictureProfileChangedListener::IPictureProfileChangedListener,
- PictureParameter::PictureParameter,
+ ParamCapability::ParamCapability,
+ ParameterName::ParameterName,
PictureParameters::PictureParameters,
ISoundProfileAdjustmentListener::ISoundProfileAdjustmentListener,
ISoundProfileChangedListener::ISoundProfileChangedListener,
- SoundParameter::SoundParameter,
SoundParameters::SoundParameters,
+ VendorParamCapability::VendorParamCapability,
+ VendorParameterIdentifier::VendorParameterIdentifier,
};
-use binder::{Interface, ParcelableHolder, Strong};
+use binder::{Interface, Strong};
use std::sync::{Arc, Mutex};
use std::thread;
@@ -220,23 +222,9 @@
Ok(())
}
- fn getPictureParameters(&self, id: i64) -> binder::Result<PictureParameters>{
- let picture_parameters = match id {
- 1 => {
- vec![
- PictureParameter::Brightness(0.5),
- PictureParameter::Contrast(50),
- ]
- },
- _ => vec![]
- };
-
- let picture_params = PictureParameters {
- pictureParameters: picture_parameters,
- vendorPictureParameters: ParcelableHolder::default(),
- };
-
- Ok(picture_params)
+ fn sendDefaultPictureParameters(&self, _picture_parameters: &PictureParameters) -> binder::Result<()>{
+ println!("Received picture parameters");
+ Ok(())
}
fn getSoundProfileListener(&self) -> binder::Result<binder::Strong<dyn ISoundProfileChangedListener>> {
@@ -255,22 +243,36 @@
Ok(())
}
- fn getSoundParameters(&self, id: i64) -> binder::Result<SoundParameters>{
- let sound_parameters = match id {
- 1 => {
- vec![
- SoundParameter::Balance(50),
- SoundParameter::Bass(50),
- ]
- },
- _ => vec![]
- };
+ fn sendDefaultSoundParameters(&self, _sound_parameters: &SoundParameters) -> binder::Result<()>{
+ println!("Received sound parameters");
+ Ok(())
+ }
- let sound_params = SoundParameters {
- soundParameters: sound_parameters,
- vendorSoundParameters: ParcelableHolder::default(),
- };
+ fn getParamCaps(
+ &self,
+ param_names: &[ParameterName],
+ _caps: &mut Vec<ParamCapability>
+ ) -> binder::Result<()> {
+ println!("getParamCaps. len= {}", param_names.len());
+ Ok(())
+ }
- Ok(sound_params)
+ fn getVendorParamCaps(
+ &self,
+ param_names: &[VendorParameterIdentifier],
+ _caps: &mut Vec<VendorParamCapability>
+ ) -> binder::Result<()> {
+ println!("getVendorParamCaps. len= {}", param_names.len());
+ Ok(())
+ }
+
+ fn sendPictureParameters(&self, _picture_parameters: &PictureParameters) -> binder::Result<()>{
+ println!("Received picture parameters");
+ Ok(())
+ }
+
+ fn sendSoundParameters(&self, _sound_parameters: &SoundParameters) -> binder::Result<()>{
+ println!("Received sound parameters");
+ Ok(())
}
}
diff --git a/tv/mediaquality/aidl/vts/functional/VtsHalMediaQualityTest.cpp b/tv/mediaquality/aidl/vts/functional/VtsHalMediaQualityTest.cpp
index c1cc898..84f798b 100644
--- a/tv/mediaquality/aidl/vts/functional/VtsHalMediaQualityTest.cpp
+++ b/tv/mediaquality/aidl/vts/functional/VtsHalMediaQualityTest.cpp
@@ -23,8 +23,10 @@
#include <aidl/android/hardware/tv/mediaquality/BnPictureProfileAdjustmentListener.h>
#include <aidl/android/hardware/tv/mediaquality/BnSoundProfileAdjustmentListener.h>
#include <aidl/android/hardware/tv/mediaquality/IMediaQuality.h>
+#include <aidl/android/hardware/tv/mediaquality/PictureParameter.h>
#include <aidl/android/hardware/tv/mediaquality/PictureParameters.h>
#include <aidl/android/hardware/tv/mediaquality/PictureProfile.h>
+#include <aidl/android/hardware/tv/mediaquality/SoundParameter.h>
#include <aidl/android/hardware/tv/mediaquality/SoundParameters.h>
#include <aidl/android/hardware/tv/mediaquality/SoundProfile.h>
@@ -42,10 +44,15 @@
using aidl::android::hardware::tv::mediaquality::BnPictureProfileAdjustmentListener;
using aidl::android::hardware::tv::mediaquality::BnSoundProfileAdjustmentListener;
using aidl::android::hardware::tv::mediaquality::IMediaQuality;
+using aidl::android::hardware::tv::mediaquality::ParamCapability;
+using aidl::android::hardware::tv::mediaquality::PictureParameter;
using aidl::android::hardware::tv::mediaquality::PictureParameters;
using aidl::android::hardware::tv::mediaquality::PictureProfile;
+using aidl::android::hardware::tv::mediaquality::SoundParameter;
using aidl::android::hardware::tv::mediaquality::SoundParameters;
using aidl::android::hardware::tv::mediaquality::SoundProfile;
+using aidl::android::hardware::tv::mediaquality::VendorParamCapability;
+using aidl::android::hardware::tv::mediaquality::VendorParameterIdentifier;
using android::ProcessState;
using android::String16;
using ndk::ScopedAStatus;
@@ -79,6 +86,17 @@
return ScopedAStatus::ok();
}
+ ScopedAStatus onParamCapabilityChanged(int64_t, const std::vector<ParamCapability>&) override {
+ return ScopedAStatus::ok();
+ }
+
+ ScopedAStatus onVendorParamCapabilityChanged(int64_t,
+ const std::vector<VendorParamCapability>&) {
+ return ScopedAStatus::ok();
+ }
+
+ ScopedAStatus onRequestPictureParameters(int64_t) { return ScopedAStatus::ok(); }
+
private:
std::function<void(const PictureProfile& pictureProfile)> on_hal_picture_profile_adjust_;
};
@@ -94,6 +112,17 @@
return ScopedAStatus::ok();
}
+ ScopedAStatus onParamCapabilityChanged(int64_t, const std::vector<ParamCapability>&) override {
+ return ScopedAStatus::ok();
+ }
+
+ ScopedAStatus onVendorParamCapabilityChanged(int64_t,
+ const std::vector<VendorParamCapability>&) {
+ return ScopedAStatus::ok();
+ }
+
+ ScopedAStatus onRequestSoundParameters(int64_t) { return ScopedAStatus::ok(); }
+
private:
std::function<void(const SoundProfile& soundProfile)> on_hal_sound_profile_adjust_;
};
@@ -142,11 +171,20 @@
ASSERT_OK(mediaquality->setPictureProfileAdjustmentListener(listener));
}
-TEST_P(MediaQualityAidl, TestGetPictureParameters) {
- PictureParameters pictureParams;
- auto result = mediaquality->getPictureParameters(1, &pictureParams);
- ASSERT_TRUE(result.isOk());
- ASSERT_EQ(pictureParams.pictureParameters.size(), 2);
+TEST_P(MediaQualityAidl, TestSendDefaultPictureParameters) {
+ PictureParameters pictureParameters;
+ std::vector<PictureParameter> picParams;
+
+ PictureParameter brightnessParam;
+ brightnessParam.set<PictureParameter::Tag::brightness>(0.5f);
+ picParams.push_back(brightnessParam);
+
+ PictureParameter contrastParam;
+ contrastParam.set<PictureParameter::Tag::contrast>(50);
+ picParams.push_back(contrastParam);
+
+ pictureParameters.pictureParameters = picParams;
+ ASSERT_OK(mediaquality->sendDefaultPictureParameters(pictureParameters));
}
TEST_P(MediaQualityAidl, TestSetSoundProfileAdjustmentListener) {
@@ -156,11 +194,20 @@
ASSERT_OK(mediaquality->setSoundProfileAdjustmentListener(listener));
}
-TEST_P(MediaQualityAidl, TestGetSoundParameters) {
- SoundParameters soundParams;
- auto result = mediaquality->getSoundParameters(1, &soundParams);
- ASSERT_TRUE(result.isOk());
- ASSERT_EQ(soundParams.soundParameters.size(), 2);
+TEST_P(MediaQualityAidl, TestSendDefaultSoundParameters) {
+ SoundParameters soundParameters;
+ std::vector<SoundParameter> soundParams;
+
+ SoundParameter balanceParam;
+ balanceParam.set<SoundParameter::Tag::balance>(50);
+ soundParams.push_back(balanceParam);
+
+ SoundParameter bassParam;
+ bassParam.set<SoundParameter::Tag::bass>(50);
+ soundParams.push_back(bassParam);
+
+ soundParameters.soundParameters = soundParams;
+ ASSERT_OK(mediaquality->sendDefaultSoundParameters(soundParameters));
}
TEST_P(MediaQualityAidl, TestSetAmbientBacklightDetector) {
diff --git a/virtualization/capabilities_service/aidl/Android.bp b/virtualization/capabilities_service/aidl/Android.bp
new file mode 100644
index 0000000..b0bbbdd
--- /dev/null
+++ b/virtualization/capabilities_service/aidl/Android.bp
@@ -0,0 +1,35 @@
+// Copyright (C) 2024 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package {
+ default_team: "trendy_team_virtualization",
+ default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+aidl_interface {
+ name: "android.hardware.virtualization.capabilities.capabilities_service",
+ vendor_available: true,
+ srcs: ["android/**/*.aidl"],
+ stability: "vintf",
+ backend: {
+ rust: {
+ enabled: true,
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.virt",
+ ],
+ },
+ },
+ frozen: false,
+}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl b/virtualization/capabilities_service/aidl/aidl_api/android.hardware.virtualization.capabilities.capabilities_service/current/android/hardware/virtualization/capabilities/IVmCapabilitiesService.aidl
similarity index 89%
copy from gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
copy to virtualization/capabilities_service/aidl/aidl_api/android.hardware.virtualization.capabilities.capabilities_service/current/android/hardware/virtualization/capabilities/IVmCapabilitiesService.aidl
index ae709d4..68ff021 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
+++ b/virtualization/capabilities_service/aidl/aidl_api/android.hardware.virtualization.capabilities.capabilities_service/current/android/hardware/virtualization/capabilities/IVmCapabilitiesService.aidl
@@ -31,14 +31,8 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.gnss.gnss_assistance;
-/* @hide */
+package android.hardware.virtualization.capabilities;
@VintfStability
-parcelable TimeOfClock {
- int year;
- int month;
- int day;
- int hour;
- int minute;
- int seconds;
+interface IVmCapabilitiesService {
+ void grantAccessToVendorTeeServices(in ParcelFileDescriptor vmFd, in String[] vendorTeeServices);
}
diff --git a/virtualization/capabilities_service/aidl/android/hardware/virtualization/capabilities/IVmCapabilitiesService.aidl b/virtualization/capabilities_service/aidl/android/hardware/virtualization/capabilities/IVmCapabilitiesService.aidl
new file mode 100644
index 0000000..0d09ecb
--- /dev/null
+++ b/virtualization/capabilities_service/aidl/android/hardware/virtualization/capabilities/IVmCapabilitiesService.aidl
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2024 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.virtualization.capabilities;
+
+/**
+ * Encapsulates vendor-specific capabilities that can be granted to VMs.
+ */
+@VintfStability
+interface IVmCapabilitiesService {
+ /**
+ * Grant access for the VM represented by the given vm_fd to the given vendor-owned tee
+ * services. The names in |vendorTeeServices| must match the ones defined in the
+ * tee_service_contexts files.
+ * TODO(ioffe): link to the integration doc for custom smc filtering feature once
+ * it's ready.
+ */
+ void grantAccessToVendorTeeServices(
+ in ParcelFileDescriptor vmFd, in String[] vendorTeeServices);
+}
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 6482eac..565f33a 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
@@ -109,6 +109,7 @@
T2LM_NEGOTIATION = (1 << 8) /* 256 */,
SET_VOIP_MODE = (1 << 9) /* 512 */,
MLO_SAP = (1 << 10) /* 1024 */,
+ MULTIPLE_MLD_ON_SAP = (1 << 11) /* 2048 */,
}
@VintfStability
parcelable ChipConcurrencyCombinationLimit {
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl
index 8c44330..9d982b8 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl
@@ -72,4 +72,5 @@
oneway void notifyInitiateBootstrappingResponse(in char id, in android.hardware.wifi.NanStatus status, in int bootstrappingInstanceId);
oneway void notifyRespondToBootstrappingIndicationResponse(in char id, in android.hardware.wifi.NanStatus status);
oneway void notifyTerminatePairingResponse(in char id, in android.hardware.wifi.NanStatus status);
+ oneway void notifyRangingResults(in android.hardware.wifi.RttResult[] results, in byte discoverySessionId);
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCapabilities.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCapabilities.aidl
index a30893a..0722a04 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCapabilities.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCapabilities.aidl
@@ -54,4 +54,7 @@
boolean supportsPairing;
boolean supportsSetClusterId;
boolean supportsSuspension;
+ boolean supportsPeriodicRanging;
+ android.hardware.wifi.RttBw maxSupportedBandwidth;
+ int maxNumRxChainsSupported;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDiscoveryCommonConfig.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDiscoveryCommonConfig.aidl
index 96d940a..58e62db 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDiscoveryCommonConfig.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDiscoveryCommonConfig.aidl
@@ -55,4 +55,7 @@
char distanceIngressCm;
char distanceEgressCm;
boolean enableSessionSuspendability;
+ int rttBurstSize;
+ android.hardware.wifi.RttPreamble preamble;
+ @nullable android.hardware.wifi.WifiChannelInfo channelInfo;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPublishRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPublishRequest.aidl
index bdc8357..90e9a8b 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPublishRequest.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPublishRequest.aidl
@@ -41,4 +41,5 @@
android.hardware.wifi.NanPairingConfig pairingConfig;
byte[16] identityKey;
@nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+ boolean rangingResultsRequired;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttSecureConfig.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttSecureConfig.aidl
index 64e81de..5cb1aaa 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttSecureConfig.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttSecureConfig.aidl
@@ -37,5 +37,5 @@
android.hardware.wifi.PasnConfig pasnConfig;
boolean enableSecureHeLtf;
boolean enableRangingFrameProtection;
- byte[] pasnComebackCookie;
+ @nullable byte[] pasnComebackCookie;
}
diff --git a/wifi/aidl/android/hardware/wifi/IWifiChip.aidl b/wifi/aidl/android/hardware/wifi/IWifiChip.aidl
index 78508cf..5a5e4a7 100644
--- a/wifi/aidl/android/hardware/wifi/IWifiChip.aidl
+++ b/wifi/aidl/android/hardware/wifi/IWifiChip.aidl
@@ -91,6 +91,14 @@
* Chip supports Wi-Fi 7 MLO SoftAp.
*/
MLO_SAP = 1 << 10,
+ /**
+ * Chip supports multiple Wi-Fi 7 multi-link devices (MLD) on SoftAp.
+ * When this feature flag is enabled, it is an indication that the chip can
+ * support Bridged-SoftAp in 11be with separate MLD MAC addresses.
+ * When this feature is disabled, then only one MLD address can be used in 11be mode
+ * (if supported), this includes use of MLO if MLO_SAP flag is set to True.
+ */
+ MULTIPLE_MLD_ON_SAP = 1 << 11,
}
/**
diff --git a/wifi/aidl/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl b/wifi/aidl/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl
index 3649b7b..376dcac 100644
--- a/wifi/aidl/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl
+++ b/wifi/aidl/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl
@@ -29,6 +29,7 @@
import android.hardware.wifi.NanPairingRequestInd;
import android.hardware.wifi.NanStatus;
import android.hardware.wifi.NanSuspensionModeChangeInd;
+import android.hardware.wifi.RttResult;
/**
* NAN Response and Asynchronous Event Callbacks.
*
@@ -461,4 +462,12 @@
* |NanStatusCode.INVALID_PAIRING_ID|
*/
void notifyTerminatePairingResponse(in char id, in NanStatus status);
+
+ /**
+ * Callback is invoked when ranging results are available.
+ *
+ * @param results RttResult data.
+ * @param discoverySessionId Discovery session ID.
+ */
+ void notifyRangingResults(in RttResult[] results, in byte discoverySessionId);
}
diff --git a/wifi/aidl/android/hardware/wifi/NanCapabilities.aidl b/wifi/aidl/android/hardware/wifi/NanCapabilities.aidl
index f581c5e..f9f825f 100644
--- a/wifi/aidl/android/hardware/wifi/NanCapabilities.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanCapabilities.aidl
@@ -16,6 +16,8 @@
package android.hardware.wifi;
+import android.hardware.wifi.RttBw;
+
/**
* NDP Capabilities response.
*/
@@ -103,4 +105,16 @@
* Flag to indicate if NAN suspension is supported.
*/
boolean supportsSuspension;
+ /**
+ * Flag to indicate if NAN periodic ranging is supported.
+ */
+ boolean supportsPeriodicRanging;
+ /**
+ * Maximum supported bandwidth.
+ */
+ RttBw maxSupportedBandwidth;
+ /**
+ * Maximum number of supported receive chains.
+ */
+ int maxNumRxChainsSupported;
}
diff --git a/wifi/aidl/android/hardware/wifi/NanDiscoveryCommonConfig.aidl b/wifi/aidl/android/hardware/wifi/NanDiscoveryCommonConfig.aidl
index 4bedce0..725ed3c 100644
--- a/wifi/aidl/android/hardware/wifi/NanDiscoveryCommonConfig.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanDiscoveryCommonConfig.aidl
@@ -18,6 +18,8 @@
import android.hardware.wifi.NanDataPathSecurityConfig;
import android.hardware.wifi.NanMatchAlg;
+import android.hardware.wifi.RttPreamble;
+import android.hardware.wifi.WifiChannelInfo;
/**
* Configurations of NAN discovery sessions. Common to publish and subscribe discovery.
@@ -136,10 +138,14 @@
*/
boolean rangingRequired;
/**
- * Interval in ms between two ranging measurements. Only relevant if |rangingRequired| is true.
+ * Interval in ms between two ranging measurements. Only applies to periodic ranging and is
+ * only relevant if |rangingRequired| is true.
+ *
* If the Awake DW interval specified either in |discoveryWindowPeriod| or in
* |NanBandSpecificConfig.discoveryWindowIntervalVal| is larger than the ranging interval then
* priority is given to Awake DW interval.
+ *
+ * If this is set to 0, then only one ranging is performed.
*/
int rangingIntervalMs;
/**
@@ -162,4 +168,16 @@
* |NanCapabilities.supportsSuspension| is false.
*/
boolean enableSessionSuspendability;
+ /**
+ * The number of FTM packets used to estimate a range.
+ */
+ int rttBurstSize;
+ /**
+ * RTT preamble to be used in the RTT frames.
+ */
+ RttPreamble preamble;
+ /**
+ * Channel information.
+ */
+ @nullable WifiChannelInfo channelInfo;
}
diff --git a/wifi/aidl/android/hardware/wifi/NanPublishRequest.aidl b/wifi/aidl/android/hardware/wifi/NanPublishRequest.aidl
index ae75caf..09ea496 100644
--- a/wifi/aidl/android/hardware/wifi/NanPublishRequest.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanPublishRequest.aidl
@@ -61,4 +61,9 @@
* that no vendor data is provided.
*/
@nullable OuiKeyedData[] vendorData;
+ /**
+ * If |NanCapabilities.supportsPeriodicRanging| is true, then this field specifies whether the
+ * ranging results need to be notified to the Publisher when they are available.
+ */
+ boolean rangingResultsRequired;
}
diff --git a/wifi/aidl/android/hardware/wifi/PasnConfig.aidl b/wifi/aidl/android/hardware/wifi/PasnConfig.aidl
index 4c6b5bf..37ef03c 100644
--- a/wifi/aidl/android/hardware/wifi/PasnConfig.aidl
+++ b/wifi/aidl/android/hardware/wifi/PasnConfig.aidl
@@ -22,12 +22,13 @@
@VintfStability
parcelable PasnConfig {
/**
- * Base Authentication and Key Management (AKM) protocol used for PASN as defined in |Akm|.
+ * Base Authentication and Key Management (AKM) protocol used for PASN. Represented as
+ * at bitmap of |Akm|.
*/
long baseAkm;
/**
- * Pairwise cipher suite used for the PTKSA (Pairwise Transient Key Security Association)
- * as defined in |CipherSuite|
+ * Pairwise cipher suite used for the PTKSA (Pairwise Transient Key Security Association).
+ * Represented as a bitmap of |CipherSuite|.
*/
long cipherSuite;
/**
diff --git a/wifi/aidl/android/hardware/wifi/RttResult.aidl b/wifi/aidl/android/hardware/wifi/RttResult.aidl
index 16b823d..361d7e9 100644
--- a/wifi/aidl/android/hardware/wifi/RttResult.aidl
+++ b/wifi/aidl/android/hardware/wifi/RttResult.aidl
@@ -222,12 +222,13 @@
*/
boolean isSecureLtfEnabled;
/**
- * Base Authentication and Key Management (AKM) protocol used for PASN as defined in |Akm|.
+ * Base Authentication and Key Management (AKM) protocol used for PASN. Represented as
+ * at bitmap of |Akm|.
*/
long baseAkm;
/**
- * Pairwise cipher suite used for the PTKSA (Pairwise Transient Key Security Association)
- * as defined in |CipherSuite|
+ * Pairwise cipher suite used for the PTKSA (Pairwise Transient Key Security Association).
+ * Represented as a bitmap of |CipherSuite|.
*/
long cipherSuite;
/**
diff --git a/wifi/aidl/android/hardware/wifi/RttSecureConfig.aidl b/wifi/aidl/android/hardware/wifi/RttSecureConfig.aidl
index d1394ab..0d1350e 100644
--- a/wifi/aidl/android/hardware/wifi/RttSecureConfig.aidl
+++ b/wifi/aidl/android/hardware/wifi/RttSecureConfig.aidl
@@ -38,5 +38,5 @@
/**
* Comeback cookie is an opaque sequence of octets retrieved from |RttResult|.
*/
- byte[] pasnComebackCookie;
+ @nullable byte[] pasnComebackCookie;
}
diff --git a/wifi/aidl/default/aidl_struct_util.cpp b/wifi/aidl/default/aidl_struct_util.cpp
index bf6c206..75e9bfe 100644
--- a/wifi/aidl/default/aidl_struct_util.cpp
+++ b/wifi/aidl/default/aidl_struct_util.cpp
@@ -26,6 +26,9 @@
namespace aidl_struct_util {
WifiChannelWidthInMhz convertLegacyWifiChannelWidthToAidl(legacy_hal::wifi_channel_width type);
+bool convertAidlWifiChannelInfoToLegacy(const WifiChannelInfo& aidl_info,
+ legacy_hal::wifi_channel_info* legacy_info);
+RttBw convertLegacyRttBwToAidl(legacy_hal::wifi_rtt_bw type);
std::string safeConvertChar(const char* str, size_t max_len) {
const char* c = str;
@@ -1859,7 +1862,9 @@
legacy_request->ranging_auto_response = aidl_request.baseConfigs.rangingRequired
? legacy_hal::NAN_RANGING_AUTO_RESPONSE_ENABLE
: legacy_hal::NAN_RANGING_AUTO_RESPONSE_DISABLE;
- legacy_request->sdea_params.range_report = legacy_hal::NAN_DISABLE_RANGE_REPORT;
+ legacy_request->sdea_params.range_report = aidl_request.rangingResultsRequired
+ ? legacy_hal::NAN_ENABLE_RANGE_REPORT
+ : legacy_hal::NAN_DISABLE_RANGE_REPORT;
legacy_request->publish_type = convertAidlNanPublishTypeToLegacy(aidl_request.publishType);
legacy_request->tx_type = convertAidlNanTxTypeToLegacy(aidl_request.txType);
legacy_request->service_responder_policy = aidl_request.autoAcceptDataPathRequests
@@ -1988,6 +1993,17 @@
legacy_request->ranging_cfg.distance_ingress_mm =
aidl_request.baseConfigs.distanceIngressCm * 10;
legacy_request->ranging_cfg.distance_egress_mm = aidl_request.baseConfigs.distanceEgressCm * 10;
+ legacy_request->ranging_cfg.rtt_burst_size = aidl_request.baseConfigs.rttBurstSize;
+ legacy_request->ranging_cfg.preamble =
+ convertAidlRttPreambleToLegacy(aidl_request.baseConfigs.preamble);
+ if (aidl_request.baseConfigs.channelInfo.has_value()) {
+ if (!convertAidlWifiChannelInfoToLegacy(aidl_request.baseConfigs.channelInfo.value(),
+ &legacy_request->ranging_cfg.channel_info)) {
+ LOG(ERROR) << "convertAidlNanSubscribeRequestToLegacy: "
+ "Unable to convert aidl channel info to legacy";
+ return false;
+ }
+ }
legacy_request->ranging_auto_response = aidl_request.baseConfigs.rangingRequired
? legacy_hal::NAN_RANGING_AUTO_RESPONSE_ENABLE
: legacy_hal::NAN_RANGING_AUTO_RESPONSE_DISABLE;
@@ -2296,6 +2312,9 @@
aidl_response->supportsPairing = legacy_response.is_pairing_supported;
aidl_response->supportsSetClusterId = legacy_response.is_set_cluster_id_supported;
aidl_response->supportsSuspension = legacy_response.is_suspension_supported;
+ aidl_response->supportsPeriodicRanging = legacy_response.is_periodic_ranging_supported;
+ aidl_response->maxSupportedBandwidth = convertLegacyRttBwToAidl(legacy_response.supported_bw);
+ aidl_response->maxNumRxChainsSupported = legacy_response.num_rx_chains_supported;
return true;
}
diff --git a/wifi/aidl/default/aidl_struct_util.h b/wifi/aidl/default/aidl_struct_util.h
index 2574f95..9a3c535 100644
--- a/wifi/aidl/default/aidl_struct_util.h
+++ b/wifi/aidl/default/aidl_struct_util.h
@@ -231,6 +231,8 @@
TwtSession* aidl_twt_session);
bool convertLegacyHalTwtSessionStatsToAidl(legacy_hal::wifi_twt_session_stats twt_stats,
TwtSessionStats* aidl_twt_stats);
+legacy_hal::wifi_rtt_preamble convertAidlRttPreambleToLegacy(RttPreamble type);
+
} // namespace aidl_struct_util
} // namespace wifi
} // namespace hardware
diff --git a/wifi/aidl/default/tests/wifi_nan_iface_unit_tests.cpp b/wifi/aidl/default/tests/wifi_nan_iface_unit_tests.cpp
index d58a9b0..513f440 100644
--- a/wifi/aidl/default/tests/wifi_nan_iface_unit_tests.cpp
+++ b/wifi/aidl/default/tests/wifi_nan_iface_unit_tests.cpp
@@ -138,6 +138,7 @@
MOCK_METHOD2(notifyResumeResponse, ndk::ScopedAStatus(char16_t, const NanStatus&));
MOCK_METHOD2(notifyTerminatePairingResponse, ndk::ScopedAStatus(char16_t, const NanStatus&));
MOCK_METHOD1(eventSuspensionModeChanged, ndk::ScopedAStatus(const NanSuspensionModeChangeInd&));
+ MOCK_METHOD2(notifyRangingResults, ndk::ScopedAStatus(const std::vector<RttResult>&, int8_t));
};
class WifiNanIfaceTest : public Test {
diff --git a/wifi/aidl/default/wifi_legacy_hal.cpp b/wifi/aidl/default/wifi_legacy_hal.cpp
index bd92a20..8d69013 100644
--- a/wifi/aidl/default/wifi_legacy_hal.cpp
+++ b/wifi/aidl/default/wifi_legacy_hal.cpp
@@ -372,6 +372,16 @@
}
}
+std::function<void(wifi_rtt_result* rtt_results[], uint32_t num_results, uint16_t session_id)>
+ on_nan_event_ranging_results_callback;
+void onAsyncNanEventRangingResults(wifi_rtt_result* rtt_results[], uint32_t num_results,
+ uint16_t session_id) {
+ const auto lock = aidl_sync_util::acquireGlobalLock();
+ if (on_nan_event_ranging_results_callback && rtt_results) {
+ on_nan_event_ranging_results_callback(rtt_results, num_results, session_id);
+ }
+}
+
std::function<void(const NanPairingRequestInd&)> on_nan_event_pairing_request_user_callback;
void onAsyncNanEventPairingRequest(NanPairingRequestInd* event) {
const auto lock = aidl_sync_util::acquireGlobalLock();
@@ -1510,6 +1520,7 @@
on_nan_event_schedule_update_user_callback = user_callbacks.on_event_schedule_update;
on_nan_event_suspension_mode_change_user_callback =
user_callbacks.on_event_suspension_mode_change;
+ on_nan_event_ranging_results_callback = user_callbacks.on_ranging_results;
return global_func_table_.wifi_nan_register_handler(getIfaceHandle(iface_name),
{onAsyncNanNotifyResponse,
@@ -1534,7 +1545,8 @@
onAsyncNanEventPairingConfirm,
onAsyncNanEventBootstrappingRequest,
onAsyncNanEventBootstrappingConfirm,
- onAsyncNanEventSuspensionModeChange});
+ onAsyncNanEventSuspensionModeChange,
+ onAsyncNanEventRangingResults});
}
wifi_error WifiLegacyHal::nanEnableRequest(const std::string& iface_name, transaction_id id,
diff --git a/wifi/aidl/default/wifi_legacy_hal.h b/wifi/aidl/default/wifi_legacy_hal.h
index aa563cb..f603210 100644
--- a/wifi/aidl/default/wifi_legacy_hal.h
+++ b/wifi/aidl/default/wifi_legacy_hal.h
@@ -63,6 +63,7 @@
using ::NAN_DP_REQUEST_CHANNEL_SETUP;
using ::NAN_DP_REQUEST_REJECT;
using ::NAN_DP_RESPONDER_RESPONSE;
+using ::NAN_ENABLE_RANGE_REPORT;
using ::NAN_GET_CAPABILITIES;
using ::NAN_MATCH_ALG_MATCH_CONTINUOUS;
using ::NAN_MATCH_ALG_MATCH_NEVER;
@@ -488,6 +489,8 @@
std::function<void(const NanBootstrappingRequestInd&)> on_event_bootstrapping_request;
std::function<void(const NanBootstrappingConfirmInd&)> on_event_bootstrapping_confirm;
std::function<void(const NanSuspensionModeChangeInd&)> on_event_suspension_mode_change;
+ std::function<void(wifi_rtt_result* rtt_results[], uint32_t num_results, uint16_t session_id)>
+ on_ranging_results;
};
// Full scan results contain IE info and are hence passed by reference, to
diff --git a/wifi/aidl/default/wifi_nan_iface.cpp b/wifi/aidl/default/wifi_nan_iface.cpp
index 9d50798..950e647 100644
--- a/wifi/aidl/default/wifi_nan_iface.cpp
+++ b/wifi/aidl/default/wifi_nan_iface.cpp
@@ -613,7 +613,36 @@
}
}
};
+ callback_handlers.on_ranging_results = [weak_ptr_this](
+ legacy_hal::wifi_rtt_result* rtt_results[],
+ uint32_t num_results, uint16_t session_id) {
+ const auto shared_ptr_this = weak_ptr_this.lock();
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ if (shared_ptr_this->getMinCallbackVersion() < 3) {
+ LOG(INFO) << "notifyRangingResults requires callback version 3";
+ return;
+ }
+ std::vector<const wifi_rtt_result*> legacy_results;
+ std::copy_if(rtt_results, rtt_results + num_results, back_inserter(legacy_results),
+ [](wifi_rtt_result* rtt_result) { return rtt_result != nullptr; });
+
+ std::vector<RttResult> aidl_results;
+ if (!aidl_struct_util::convertLegacyVectorOfRttResultToAidl(legacy_results,
+ &aidl_results)) {
+ LOG(ERROR) << "Failed to convert RTT results to AIDL structs";
+ return;
+ }
+
+ for (const auto& callback : shared_ptr_this->getEventCallbacks()) {
+ if (!callback->notifyRangingResults(aidl_results, session_id).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ };
legacy_hal::wifi_error legacy_status =
legacy_hal_.lock()->nanRegisterCallbackHandlers(ifname_, callback_handlers);
if (legacy_status != legacy_hal::WIFI_SUCCESS) {
diff --git a/wifi/aidl/vts/functional/wifi_nan_iface_aidl_test.cpp b/wifi/aidl/vts/functional/wifi_nan_iface_aidl_test.cpp
index bc169a4..d646162 100644
--- a/wifi/aidl/vts/functional/wifi_nan_iface_aidl_test.cpp
+++ b/wifi/aidl/vts/functional/wifi_nan_iface_aidl_test.cpp
@@ -58,6 +58,7 @@
using aidl::android::hardware::wifi::NanStatusCode;
using aidl::android::hardware::wifi::NanSuspensionModeChangeInd;
using aidl::android::hardware::wifi::NanTxType;
+using aidl::android::hardware::wifi::RttResult;
#define TIMEOUT_PERIOD 10
@@ -106,6 +107,7 @@
NOTIFY_SUSPEND_RESPONSE,
NOTIFY_RESUME_RESPONSE,
NOTIFY_TERMINATE_PAIRING_RESPONSE,
+ NOTIFY_RANGING_RESULTS,
EVENT_CLUSTER_EVENT,
EVENT_DISABLED,
@@ -400,6 +402,12 @@
parent_.notify(NOTIFY_TERMINATE_PAIRING_RESPONSE);
return ndk::ScopedAStatus::ok();
}
+ ::ndk::ScopedAStatus notifyRangingResults(const std::vector<RttResult>& /* results */,
+ int8_t discoverySessionId) override {
+ parent_.session_id_ = discoverySessionId;
+ parent_.notify(NOTIFY_RANGING_RESULTS);
+ return ndk::ScopedAStatus::ok();
+ }
private:
WifiNanIfaceAidlTest& parent_;
diff --git a/wifi/hostapd/aidl/Android.bp b/wifi/hostapd/aidl/Android.bp
index e580573..85d71f3 100644
--- a/wifi/hostapd/aidl/Android.bp
+++ b/wifi/hostapd/aidl/Android.bp
@@ -41,7 +41,9 @@
],
min_sdk_version: "30",
lint: {
- baseline_filename: "lint-baseline.xml",
+ // Disable linter to avoid error about fixed size arrays.
+ // Interface will only be accessed on devices >= T.
+ enabled: false,
},
},
ndk: {
diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/ApInfo.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/ApInfo.aidl
index f8320c6..0af90d2 100644
--- a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/ApInfo.aidl
+++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/ApInfo.aidl
@@ -41,5 +41,5 @@
android.hardware.wifi.hostapd.Generation generation;
byte[] apIfaceInstanceMacAddress;
@nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
- @nullable byte[] mldMacAddress;
+ @nullable byte[6] mldMacAddress;
}
diff --git a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/ApInfo.aidl b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/ApInfo.aidl
index 4e1e1c8..8aea70c 100644
--- a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/ApInfo.aidl
+++ b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/ApInfo.aidl
@@ -67,5 +67,5 @@
/**
* MAC Address of the multiple link device (MLD) which apIfaceInstance is associated with.
*/
- @nullable byte[] mldMacAddress;
+ @nullable byte[6] mldMacAddress;
}
diff --git a/wifi/legacy_headers/include/hardware_legacy/wifi_nan.h b/wifi/legacy_headers/include/hardware_legacy/wifi_nan.h
index 4e490d9..cd4e86d 100644
--- a/wifi/legacy_headers/include/hardware_legacy/wifi_nan.h
+++ b/wifi/legacy_headers/include/hardware_legacy/wifi_nan.h
@@ -19,6 +19,7 @@
#include <net/if.h>
#include <stdbool.h>
+#include "rtt.h"
#include "wifi_hal.h"
#ifdef __cplusplus
@@ -476,6 +477,9 @@
bool is_pairing_supported;
bool is_set_cluster_id_supported;
bool is_suspension_supported;
+ bool is_periodic_ranging_supported;
+ wifi_rtt_bw supported_bw;
+ u8 num_rx_chains_supported;
} NanCapabilities;
/*
@@ -746,6 +750,12 @@
u32 distance_ingress_mm;
/* Egress distance in millmilliimeters (optional) */
u32 distance_egress_mm;
+ /* Number of FTM frames per burst */
+ u32 rtt_burst_size;
+ /* RTT Measurement Preamble */
+ wifi_rtt_preamble preamble;
+ /* Channel information */
+ wifi_channel_info channel_info;
} NanRangingCfg;
/* NAN Ranging request's response */
@@ -3103,6 +3113,7 @@
void (*EventBootstrappingRequest) (NanBootstrappingRequestInd* event);
void (*EventBootstrappingConfirm) (NanBootstrappingConfirmInd* event);
void (*EventSuspensionModeChange) (NanSuspensionModeChangeInd* event);
+ void (*EventRangingResults)(wifi_rtt_result* rtt_result[], u32 num_results, u16 session_id);
} NanCallbackHandler;
/**@brief nan_enable_request
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
index 2704e5c..cb96dfc 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
@@ -104,8 +104,8 @@
void configureMscs(in android.hardware.wifi.supplicant.MscsParams params);
void disableMscs();
android.hardware.wifi.supplicant.UsdCapabilities getUsdCapabilities();
- int startUsdPublish(in int cmdId, in android.hardware.wifi.supplicant.UsdPublishConfig usdPublishConfig);
- int startUsdSubscribe(in int cmdId, in android.hardware.wifi.supplicant.UsdSubscribeConfig usdSubscribeConfig);
+ void startUsdPublish(in int cmdId, in android.hardware.wifi.supplicant.UsdPublishConfig usdPublishConfig);
+ void startUsdSubscribe(in int cmdId, in android.hardware.wifi.supplicant.UsdSubscribeConfig usdSubscribeConfig);
void updateUsdPublish(in int publishId, in byte[] serviceSpecificInfo);
void cancelUsdPublish(in int publishId);
void cancelUsdSubscribe(in int subscribeId);
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
index f3703e8..5c6024a 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
@@ -897,13 +897,11 @@
* @param cmdId Identifier for this request. Will be returned in the callback to identify
* the request.
* @param usdPublishConfig Parameters for the requested publish session.
- * @return Publish ID identifying the publish session. This ID will also be returned in the
- onStarted callback when the session setup is completed successfully.
* @throws ServiceSpecificException with one of the following values:
* |SupplicantStatusCode.FAILURE_UNKNOWN|
* |SupplicantStatusCode.FAILURE_UNSUPPORTED|
*/
- int startUsdPublish(in int cmdId, in UsdPublishConfig usdPublishConfig);
+ void startUsdPublish(in int cmdId, in UsdPublishConfig usdPublishConfig);
/**
* Start a USD subscribe session. Triggers a response via
@@ -913,13 +911,11 @@
* @param cmdId Identifier for this request. Will be returned in the callback to identify
* the request.
* @param usdSubscribeConfig Parameters for the requested subscribe session.
- * @return Subscribe ID identifying the subscribe session. This ID will also be returned in the
- onStarted callback when the session setup is completed successfully.
* @throws ServiceSpecificException with one of the following values:
* |SupplicantStatusCode.FAILURE_UNKNOWN|
* |SupplicantStatusCode.FAILURE_UNSUPPORTED|
*/
- int startUsdSubscribe(in int cmdId, in UsdSubscribeConfig usdSubscribeConfig);
+ void startUsdSubscribe(in int cmdId, in UsdSubscribeConfig usdSubscribeConfig);
/**
* Update the service-specific info for an active publish session.