Loading audio/aidl/common/include/Utils.h +6 −0 Original line number Diff line number Diff line Loading @@ -174,6 +174,12 @@ constexpr U makeBitPositionFlagMask(std::initializer_list<E> flags) { return result; } template <typename E, typename U = std::underlying_type_t<E>, typename = std::enable_if_t<is_bit_position_enum<E>::value>> constexpr bool isAnyBitPositionFlagSet(U mask, std::initializer_list<E> flags) { return (mask & makeBitPositionFlagMask<E>(flags)) != 0; } constexpr int32_t frameCountFromDurationUs(long durationUs, int32_t sampleRateHz) { return (static_cast<long long>(durationUs) * sampleRateHz) / 1000000LL; } Loading audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp +21 −1 Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ using namespace android; using aidl::android::hardware::audio::common::AudioOffloadMetadata; using aidl::android::hardware::audio::common::getChannelCount; using aidl::android::hardware::audio::common::isAnyBitPositionFlagSet; using aidl::android::hardware::audio::common::isBitPositionFlagSet; using aidl::android::hardware::audio::common::isTelephonyDeviceType; using aidl::android::hardware::audio::common::isValidAudioMode; Loading Loading @@ -85,6 +86,7 @@ using aidl::android::media::audio::common::AudioDeviceDescription; using aidl::android::media::audio::common::AudioDeviceType; using aidl::android::media::audio::common::AudioDualMonoMode; using aidl::android::media::audio::common::AudioFormatType; using aidl::android::media::audio::common::AudioInputFlags; using aidl::android::media::audio::common::AudioIoFlags; using aidl::android::media::audio::common::AudioLatencyMode; using aidl::android::media::audio::common::AudioMMapPolicy; Loading Loading @@ -1749,8 +1751,13 @@ TEST_P(AudioCoreModule, TryConnectMissingDevice) { for (const auto& port : ports) { // Virtual devices may not require external hardware and thus can always be connected. if (port.ext.get<AudioPortExt::device>().device.type.connection == AudioDeviceDescription::CONNECTION_VIRTUAL) AudioDeviceDescription::CONNECTION_VIRTUAL || // SCO devices are handled at low level by DSP, may not be able to check actual // connection. port.ext.get<AudioPortExt::device>().device.type.connection == AudioDeviceDescription::CONNECTION_BT_SCO) { continue; } AudioPort portWithData = GenerateUniqueDeviceAddress(port), connectedPort; ScopedAStatus status = module->connectExternalDevice(portWithData, &connectedPort); EXPECT_STATUS(EX_ILLEGAL_STATE, status) << "static port " << portWithData.toString(); Loading Loading @@ -3780,6 +3787,19 @@ class AudioStreamIo : public AudioCoreModuleBase, } for (const auto& portConfig : allPortConfigs) { SCOPED_TRACE(portConfig.toString()); // Certain types of ports can not be used without special preconditions. if ((IOTraits<Stream>::is_input && isAnyBitPositionFlagSet( portConfig.flags.value().template get<AudioIoFlags::Tag::input>(), {AudioInputFlags::MMAP_NOIRQ, AudioInputFlags::VOIP_TX, AudioInputFlags::HW_HOTWORD})) || (!IOTraits<Stream>::is_input && isAnyBitPositionFlagSet( portConfig.flags.value().template get<AudioIoFlags::Tag::output>(), {AudioOutputFlags::MMAP_NOIRQ, AudioOutputFlags::VOIP_RX, AudioOutputFlags::COMPRESS_OFFLOAD, AudioOutputFlags::INCALL_MUSIC}))) { continue; } const bool isNonBlocking = IOTraits<Stream>::is_input ? false Loading automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl +8 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,10 @@ enum VehicleIgnitionState { * Steering wheel is not locked, engine and all accessories are OFF. If * car can be in LOCK and OFF state at the same time than HAL must report * LOCK state. * * If IGNITION_STATE is implemented on a BEV, then this state must * communicate that the BEV's High Voltage battery is disconnected and thus * the vehicle is OFF. */ OFF, /** Loading @@ -38,6 +42,10 @@ enum VehicleIgnitionState { /** * Ignition is in state ON. Accessories and instrument cluster available, * engine might be running or ready to be started. * * If IGNITION_STATE is implemented on a BEV, then this state must * communicate that the BEV's High Voltage battery is connected and thus the * vehicle is ON. */ ON, /** Loading security/sharedsecret/aidl/android/hardware/security/sharedsecret/ISharedSecret.aidl +3 −8 Original line number Diff line number Diff line Loading @@ -81,14 +81,9 @@ interface ISharedSecret { * defined in the standard. The counter is prefixed and length L appended, as shown * in the construction on page 12 of the standard. The label string is UTF-8 encoded. * * ``K'' is a pre-established shared secret, set up during factory reset. The mechanism for * establishing this shared secret is implementation-defined.Any method of securely * establishing K that ensures that an attacker cannot obtain or derive its value is * acceptable. * * CRITICAL SECURITY REQUIREMENT: All keys created by a IKeymintDevice instance must * be cryptographically bound to the value of K, such that establishing a new K * permanently destroys them. * ``K'' is a pre-established shared secret. The mechanism for establishing this shared * secret is implementation-defined. Any method of securely establishing K that * ensures that an attacker cannot obtain or derive its value is acceptable. * * ``||'' represents concatenation. * Loading Loading
audio/aidl/common/include/Utils.h +6 −0 Original line number Diff line number Diff line Loading @@ -174,6 +174,12 @@ constexpr U makeBitPositionFlagMask(std::initializer_list<E> flags) { return result; } template <typename E, typename U = std::underlying_type_t<E>, typename = std::enable_if_t<is_bit_position_enum<E>::value>> constexpr bool isAnyBitPositionFlagSet(U mask, std::initializer_list<E> flags) { return (mask & makeBitPositionFlagMask<E>(flags)) != 0; } constexpr int32_t frameCountFromDurationUs(long durationUs, int32_t sampleRateHz) { return (static_cast<long long>(durationUs) * sampleRateHz) / 1000000LL; } Loading
audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp +21 −1 Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ using namespace android; using aidl::android::hardware::audio::common::AudioOffloadMetadata; using aidl::android::hardware::audio::common::getChannelCount; using aidl::android::hardware::audio::common::isAnyBitPositionFlagSet; using aidl::android::hardware::audio::common::isBitPositionFlagSet; using aidl::android::hardware::audio::common::isTelephonyDeviceType; using aidl::android::hardware::audio::common::isValidAudioMode; Loading Loading @@ -85,6 +86,7 @@ using aidl::android::media::audio::common::AudioDeviceDescription; using aidl::android::media::audio::common::AudioDeviceType; using aidl::android::media::audio::common::AudioDualMonoMode; using aidl::android::media::audio::common::AudioFormatType; using aidl::android::media::audio::common::AudioInputFlags; using aidl::android::media::audio::common::AudioIoFlags; using aidl::android::media::audio::common::AudioLatencyMode; using aidl::android::media::audio::common::AudioMMapPolicy; Loading Loading @@ -1749,8 +1751,13 @@ TEST_P(AudioCoreModule, TryConnectMissingDevice) { for (const auto& port : ports) { // Virtual devices may not require external hardware and thus can always be connected. if (port.ext.get<AudioPortExt::device>().device.type.connection == AudioDeviceDescription::CONNECTION_VIRTUAL) AudioDeviceDescription::CONNECTION_VIRTUAL || // SCO devices are handled at low level by DSP, may not be able to check actual // connection. port.ext.get<AudioPortExt::device>().device.type.connection == AudioDeviceDescription::CONNECTION_BT_SCO) { continue; } AudioPort portWithData = GenerateUniqueDeviceAddress(port), connectedPort; ScopedAStatus status = module->connectExternalDevice(portWithData, &connectedPort); EXPECT_STATUS(EX_ILLEGAL_STATE, status) << "static port " << portWithData.toString(); Loading Loading @@ -3780,6 +3787,19 @@ class AudioStreamIo : public AudioCoreModuleBase, } for (const auto& portConfig : allPortConfigs) { SCOPED_TRACE(portConfig.toString()); // Certain types of ports can not be used without special preconditions. if ((IOTraits<Stream>::is_input && isAnyBitPositionFlagSet( portConfig.flags.value().template get<AudioIoFlags::Tag::input>(), {AudioInputFlags::MMAP_NOIRQ, AudioInputFlags::VOIP_TX, AudioInputFlags::HW_HOTWORD})) || (!IOTraits<Stream>::is_input && isAnyBitPositionFlagSet( portConfig.flags.value().template get<AudioIoFlags::Tag::output>(), {AudioOutputFlags::MMAP_NOIRQ, AudioOutputFlags::VOIP_RX, AudioOutputFlags::COMPRESS_OFFLOAD, AudioOutputFlags::INCALL_MUSIC}))) { continue; } const bool isNonBlocking = IOTraits<Stream>::is_input ? false Loading
automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl +8 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,10 @@ enum VehicleIgnitionState { * Steering wheel is not locked, engine and all accessories are OFF. If * car can be in LOCK and OFF state at the same time than HAL must report * LOCK state. * * If IGNITION_STATE is implemented on a BEV, then this state must * communicate that the BEV's High Voltage battery is disconnected and thus * the vehicle is OFF. */ OFF, /** Loading @@ -38,6 +42,10 @@ enum VehicleIgnitionState { /** * Ignition is in state ON. Accessories and instrument cluster available, * engine might be running or ready to be started. * * If IGNITION_STATE is implemented on a BEV, then this state must * communicate that the BEV's High Voltage battery is connected and thus the * vehicle is ON. */ ON, /** Loading
security/sharedsecret/aidl/android/hardware/security/sharedsecret/ISharedSecret.aidl +3 −8 Original line number Diff line number Diff line Loading @@ -81,14 +81,9 @@ interface ISharedSecret { * defined in the standard. The counter is prefixed and length L appended, as shown * in the construction on page 12 of the standard. The label string is UTF-8 encoded. * * ``K'' is a pre-established shared secret, set up during factory reset. The mechanism for * establishing this shared secret is implementation-defined.Any method of securely * establishing K that ensures that an attacker cannot obtain or derive its value is * acceptable. * * CRITICAL SECURITY REQUIREMENT: All keys created by a IKeymintDevice instance must * be cryptographically bound to the value of K, such that establishing a new K * permanently destroys them. * ``K'' is a pre-established shared secret. The mechanism for establishing this shared * secret is implementation-defined. Any method of securely establishing K that * ensures that an attacker cannot obtain or derive its value is acceptable. * * ``||'' represents concatenation. * Loading